database: prohibit PUT of source data that would lead to conflict #711
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| tests: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Set up Go | |
| uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | |
| with: | |
| go-version-file: go.mod | |
| - name: Run Makefile target `go-test` | |
| run: make go-test | |
| - name: Run Makefile target `authz-test` | |
| run: make authz-test | |
| - name: Run Makefile target `library-test` | |
| run: make library-test | |
| e2e: | |
| runs-on: ${{ matrix.run }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| run: | |
| - windows-latest | |
| - ubuntu-latest | |
| - macos-latest | |
| steps: | |
| - name: Setup OPA | |
| uses: open-policy-agent/setup-opa@950f159a49aa91f9323f36f1de81c7f6b5de9576 # v2.3.0 | |
| - name: tweak git config for long file names | |
| run: git config --system core.longpaths true | |
| if: matrix.run == 'windows-latest' | |
| - name: Checkout code | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Set up Go | |
| uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | |
| with: | |
| go-version-file: go.mod | |
| - name: build | |
| run: make build | |
| - if: runner.os == 'Windows' | |
| name: fix windows exe ending | |
| run: find . -name 'opactl_*' -exec mv {} {}.exe \; | |
| shell: bash | |
| - name: e2e | |
| run: | | |
| set -euo pipefail | |
| matches=(opactl_*) | |
| export OPACTL="$(pwd)/${matches[0]}" | |
| echo "Using OPACTL: $OPACTL" # Debugging | |
| $OPACTL version | |
| go test -tags=e2e ./e2e/... -v | |
| shell: bash | |
| env: | |
| E2E_CONTRIB_DEPLOY_KEY: ${{ secrets.E2E_CONTRIB_DEPLOY_KEY }} | |
| deploy-edge: | |
| name: Push Edge Release | |
| if: github.ref == 'refs/heads/main' # only true for pushes to `main` | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 | |
| - name: Build and Push | |
| env: | |
| DOCKER_USER: ${{ secrets.DOCKER_USER }} | |
| DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
| # Only run if required secrets are provided | |
| if: ${{ env.DOCKER_USER && env.DOCKER_PASSWORD }} | |
| run: make deploy-ci |