feat(verification): add OData support for Docker-based verification (… #30
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: Verify Codegen | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| env: | |
| BASE_IMAGE_TAG: concerto-verify-base:pr-${{ github.sha }} | |
| jobs: | |
| verify: | |
| name: verify-${{ matrix.target }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - typescript | |
| - jsonschema | |
| - graphql | |
| - protobuf | |
| - csharp | |
| - rust | |
| - java | |
| - odata | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | |
| with: | |
| egress-policy: audit | |
| - name: git checkout | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 | |
| # Buildx (docker-container driver) cannot use a locally loaded image when | |
| # BASE_IMAGE is a registry URL. Tag the base locally and build targets with | |
| # classic docker build so FROM resolves against the daemon image store. | |
| - name: Build base image | |
| uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2 | |
| with: | |
| context: . | |
| file: verification/docker/base/Dockerfile | |
| tags: ${{ env.BASE_IMAGE_TAG }} | |
| load: true | |
| cache-from: type=gha,scope=verify-base | |
| cache-to: type=gha,mode=max,scope=verify-base | |
| - name: Build target image | |
| run: | | |
| docker build \ | |
| -f "verification/docker/${{ matrix.target }}/Dockerfile" \ | |
| --build-arg "BASE_IMAGE=${{ env.BASE_IMAGE_TAG }}" \ | |
| -t "concerto-verify-${{ matrix.target }}:pr-${{ github.sha }}" \ | |
| . | |
| - name: Generate and verify in container | |
| run: | | |
| docker run --rm \ | |
| -v "$PWD/verification/corpus:/corpus:ro" \ | |
| -v "$PWD/verification/work-${{ matrix.target }}:/work" \ | |
| "concerto-verify-${{ matrix.target }}:pr-${{ github.sha }}" | |
| - name: Upload failure artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: verify-${{ matrix.target }}-output | |
| path: verification/work-${{ matrix.target }}/ |