win: rm wsl #75
This file contains 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
on: [push, pull_request, workflow_dispatch] | |
name: Test | |
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_LD_LIBRARY_PATH: /tmp | |
PACT_GO_LIB_DOWNLOAD_PATH: /tmp | |
LOG_LEVEL: info | |
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
test: | |
strategy: | |
matrix: | |
go-version: [ # https://endoflife.date/go | |
# 1.17.x, # Ended 02 Aug 2022 | |
# 1.18.x, # Ended 01 Feb 2023 | |
# 1.19.x, # Ended 8 Aug 2023 | |
# 1.20.x, | |
1.21.x | |
] | |
os: [ | |
ubuntu-latest, | |
windows-latest, | |
macos-12, | |
macos-14 | |
] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- uses: actions/setup-java@v4 # Needed for the Avro example | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Deps | |
if: matrix.os == 'macos-14' || matrix.os == 'macos-12' | |
run: brew install protobuf | |
- name: Unit Test | |
if: runner.os == 'Linux' | |
run: make ci_unit | |
# - name: Test examples | |
# if: runner.os == 'Linux' | |
# run: APP_BRANCH=${APP_REF:11} DOCKER_GATEWAY_HOST=172.17.0.1 DOCKER_HOST_HTTP="http://172.17.0.1" make ci_pact | |
- if: runner.os == 'Windows' | |
run: rm 'C:\Windows\System32\bash.exe' | |
- name: Unit Test | |
if: runner.os != 'Linux' | |
run: make ci_unit_no_docker | |
# - name: Test examples | |
# if: runner.os != 'Linux' | |
# run: make ci_pact_no_docker | |
# - name: Unit Test | |
# if: runner.os == 'Windows' | |
# run: make test | |
# env: | |
# SKIP_PLUGIN_AVRO: true | |
- name: Install goveralls | |
run: go install github.com/mattn/goveralls@latest | |
if: runner.os == 'Linux' | |
- name: Send coverage | |
run: goveralls -coverprofile=coverage.txt -service=github -parallel | |
if: runner.os == 'Linux' | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: logs-${{ github.job }}-${{ github.run_id }}-${{ github.run_attempt }}.zip | |
path: ~/.pact/plugins/**/plugin.log | |
if: ${{ always() }} && runner.os == 'Linux' | |
# finish: | |
# needs: test | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Coveralls Finished | |
# uses: coverallsapp/github-action@master | |
# with: | |
# github-token: ${{ secrets.GITHUB_TOKEN }} | |
# parallel-finished: true | |
test_alpine: | |
runs-on: [ubuntu-latest] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build image | |
run: docker build . --progress plain -t pact-go-test:amd64-alpine | |
- name: Test Unit | |
run: docker run --rm -e PACT_DO_NOT_TRACK=true -e PACT_LD_LIBRARY_PATH=$PACT_LD_LIBRARY_PATH -e PACT_GO_LIB_DOWNLOAD_PATH=$PACT_GO_LIB_DOWNLOAD_PATH pact-go-test:amd64-alpine | |
if: always() | |
- name: Test examples | |
run: docker run --rm -e PACT_DO_NOT_TRACK=true -e PACT_LD_LIBRARY_PATH=$PACT_LD_LIBRARY_PATH -e PACT_GO_LIB_DOWNLOAD_PATH=$PACT_GO_LIB_DOWNLOAD_PATH pact-go-test:amd64-alpine /bin/sh -c 'make install && make download_plugins && make pact' | |
if: always() | |
# test_alpine_arm64: | |
# runs-on: [ubuntu-latest] | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v4 | |
# - name: Set up QEMU | |
# if: runner.os == 'Linux' | |
# uses: docker/setup-qemu-action@v3 | |
# - name: Build image | |
# run: docker build . --progress plain --platform=linux/arm64 -t pact-go-test:arm64-alpine | |
# - name: Test Unit | |
# run: docker run --platform=linux/arm64 --rm -e PACT_DO_NOT_TRACK=true pact-go-test:arm64-alpine | |
# if: always() | |
# - name: Test examples | |
# run: docker run --platform=linux/arm64 --rm -e PACT_DO_NOT_TRACK=true pact-go-test:arm64-alpine /bin/sh -c 'make install && make download_plugins && make pact' | |
# if: always() | |
# finish: | |
# needs: test | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Coveralls Finished | |
# uses: coverallsapp/github-action@master | |
# with: | |
# github-token: ${{ secrets.GITHUB_TOKEN }} | |
# parallel-finished: true |