Feat/purego #1382
Workflow file for this run
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: Test | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| inputs: | |
| SKIP_ALPINE_PROVIDER_TESTS: | |
| description: 'Skip alpine provider tests' | |
| required: false | |
| default: 'false' | |
| log_level: | |
| description: 'Log level' | |
| type: choice | |
| required: true | |
| default: 'INFO' | |
| options: | |
| - 'INFO' | |
| - 'DEBUG' | |
| - 'TRACE' | |
| env: | |
| PACT_BROKER_BASE_URL: https://testdemo.pactflow.io | |
| PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }} | |
| REACT_APP_API_BASE_URL: http://localhost:8080 | |
| APP_SHA: ${{ github.sha }} | |
| APP_REF: ${{ github.ref }} | |
| # PACT_GO_LIB_DOWNLOAD_PATH: /tmp | |
| # PACT_LD_LIBRARY_PATH: /tmp | |
| LOG_LEVEL: ${{ github.event.inputs.log_level || 'INFO' }} | |
| COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| jobs: | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| go-version: [ # https://endoflife.date/go | |
| 1.24.x, | |
| 1.25.x, | |
| ] | |
| os: [ubuntu-latest, macos-15, macos-15-intel, windows-latest] | |
| cgo: [0,1] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Install Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| - uses: actions/setup-java@v5 # Needed for the Avro example | |
| with: | |
| distribution: 'zulu' | |
| java-version: '17' | |
| - name: "Set CGO_ENABLED: ${{ matrix.cgo }}" | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| "CGO_ENABLED=${{ matrix.cgo }}" >> $env:GITHUB_ENV | |
| - name: "Set CGO_ENABLED: ${{ matrix.cgo }}" | |
| if: matrix.os != 'windows-latest' | |
| run: | | |
| echo "CGO_ENABLED=${{ matrix.cgo }}" >> $GITHUB_ENV | |
| - if: matrix.os == 'macos-14' | |
| run: brew install protobuf | |
| - name: Test | |
| if: matrix.os == 'ubuntu-latest' | |
| run: APP_BRANCH=${APP_REF:11} DOCKER_GATEWAY_HOST=172.17.0.1 DOCKER_HOST_HTTP="http://172.17.0.1" make | |
| # - name: Set PACT_LD_LIBRARY_PATH | |
| # if: matrix.os == 'windows-latest' | |
| # run: | | |
| # "PACT_LD_LIBRARY_PATH=$env:TMP" >> $env:GITHUB_ENV | |
| - name: Test (unit) | |
| if: matrix.os != 'ubuntu-latest' | |
| run: make test | |
| - name: Test (pact) | |
| if: matrix.os != 'ubuntu-latest' | |
| run: make pact_local | |
| - name: Install goveralls | |
| if: matrix.os != 'windows-latest' | |
| run: go install github.com/mattn/goveralls@latest | |
| - name: Send coverage | |
| if: matrix.os != 'windows-latest' | |
| run: goveralls -coverprofile=coverage.txt -service=github -parallel | |
| - uses: actions/upload-artifact@v5 | |
| with: | |
| name: logs-${{ github.job }}-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.go-version }}-${{ matrix.os }}-${{matrix.cgo}}.zip | |
| path: ~/.pact/plugins/**/plugin.log | |
| if: ${{ always() }} | |
| test-containers: | |
| continue-on-error: ${{ matrix.experimental }} | |
| runs-on: ${{ matrix.os }} | |
| name: ${{ matrix.os }}-${{ matrix.variant }}-${{ matrix.go-version }}-test-container-cgo-${{ matrix.cgo }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, ubuntu-24.04-arm] | |
| go-version: ["1.24", "1.25"] | |
| variant: [debian] | |
| experimental: [false] | |
| cgo: [0,1] | |
| include: | |
| - variant: alpine | |
| go-version: 1.24 | |
| experimental: true | |
| os: ubuntu-latest | |
| - variant: alpine | |
| go-version: 1.25 | |
| experimental: true | |
| os: ubuntu-latest | |
| - variant: alpine | |
| go-version: 1.24 | |
| experimental: true | |
| os: ubuntu-24.04-arm | |
| - variant: alpine | |
| go-version: 1.25 | |
| experimental: true | |
| os: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Test dockerfile | |
| run: | | |
| if [[ "${{ matrix.variant }}" == "alpine" ]]; then | |
| export SKIP_PROVIDER_TESTS=true | |
| if [[ "${{ github.event.inputs.SKIP_ALPINE_PROVIDER_TESTS }}" == "false" ]]; then | |
| export SKIP_PROVIDER_TESTS=false | |
| fi | |
| fi | |
| make docker_test_all | |
| env: | |
| GO_VERSION: ${{ matrix.go-version }} | |
| IMAGE_VARIANT: ${{ matrix.variant }} | |
| CGO_ENABLED: ${{ matrix.cgo }} | |
| finish: | |
| needs: [test,test-containers] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Coveralls Finished | |
| uses: coverallsapp/github-action@main | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| parallel-finished: true |