Continuous Integration #714
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: Continuous Integration | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| # Every day at 10:09 UTC. | |
| - cron: '9 10 * * *' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| buildifier_check: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
| - name: Setup Bazel | |
| uses: cgrindel/gha_set_up_bazel@v1 | |
| with: | |
| repo_name: credential-helper | |
| - name: Run buildifier | |
| run: bazelisk run //util:buildifier.check | |
| tidy_and_test_matrix: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| runner: [macos-13, macos-15, ubuntu-22.04, windows-2025] | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
| - name: Setup Bazel | |
| uses: bazel-contrib/setup-bazel@4fd964a13a440a8aeb0be47350db2fc640f19ca8 # 0.15.0 | |
| with: | |
| bazelisk-cache: true | |
| disk-cache: ${{ github.workflow }} | |
| repository-cache: true | |
| - name: Execute Tests | |
| run: bazelisk test //... | |
| integration_test_matrix: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| runner: [macos-13, macos-15, ubuntu-22.04, windows-2025] | |
| runs-on: ${{ matrix.runner }} | |
| permissions: | |
| id-token: write | |
| contents: read | |
| packages: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v3 | |
| with: | |
| role-to-assume: arn:aws:iam::381492153904:role/git-s3-access | |
| aws-region: us-east-1 | |
| - name: Authenticate with GCP | |
| id: gauth | |
| uses: google-github-actions/auth@v1 | |
| with: | |
| workload_identity_provider: "projects/341646648187/locations/global/workloadIdentityPools/github-workload-pool/providers/github-provider" | |
| service_account: "github-service-account@git-credential-helper-dev.iam.gserviceaccount.com" | |
| export_environment_variables: true | |
| create_credentials_file: true | |
| - name: Setup Bazel | |
| uses: cgrindel/gha_set_up_bazel@v1 | |
| with: | |
| repo_name: credential-helper | |
| - name: Execute Integration Tests | |
| run: bazelisk test "//examples:integration_tests" | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
| GHCR_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} | |
| R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} | |
| AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | |
| AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | |
| AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | |
| all_ci_tests: | |
| runs-on: ubuntu-22.04 | |
| needs: [tidy_and_test_matrix, integration_test_matrix] | |
| if: ${{ always() }} | |
| steps: | |
| - name: Join Jobs | |
| uses: cgrindel/gha_join_jobs@v1 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} |