Skip to content

Commit

Permalink
ci(win): add windows gha runner / setup download dir, CGO_FLAGS and P…
Browse files Browse the repository at this point in the history
…ATH to pact_ffi.dll
  • Loading branch information
YOU54F committed Jul 25, 2024
1 parent de76480 commit f7d3a81
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
1.21.x,
1.22.x,
]
os: [ubuntu-latest, macos-12, macos-14]
os: [ubuntu-latest, macos-12, macos-14, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
Expand All @@ -43,15 +43,26 @@ jobs:
- 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 CGO_LDFLAGS / pact_ffi lib on PATH
if: matrix.os == 'windows-latest'
run: |
"CGO_LDFLAGS=-L$env:TMP" >> $env:GITHUB_ENV
"$env:TMP" >> $env:GITHUB_PATH
- name: Skip Avro plugin & test (windows)
if: matrix.os == 'windows-latest'
run: |
"SKIP_PLUGIN_AVRO=1" >> $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@v4
with:
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ PLUGIN_PACT_AVRO_VERSION=0.0.5

GO_VERSION?=1.22
ci:: docker deps clean bin test pact
PACT_DOWNLOAD_DIR=/tmp
ifeq ($(OS),Windows_NT)
PACT_DOWNLOAD_DIR=$$TMP
endif

# Run the ci target from a developer machine with the environment variables
# set as if it was on Travis CI.
Expand Down Expand Up @@ -61,10 +65,6 @@ clean:
rm -rf build output dist examples/pacts

deps: download_plugins
@echo "--- 🐿 Fetching build dependencies "
cd /tmp; \
go install github.com/mitchellh/gox@latest; \
cd -

download_plugins:
@echo "--- 🐿 Installing plugins"; \
Expand Down Expand Up @@ -106,7 +106,7 @@ cli:

install: bin
echo "--- 🐿 Installing Pact FFI dependencies"
./build/pact-go -l DEBUG install --libDir /tmp
./build/pact-go -l DEBUG install --libDir $(PACT_DOWNLOAD_DIR)

pact: clean install docker
@echo "--- 🔨 Running Pact examples"
Expand Down

0 comments on commit f7d3a81

Please sign in to comment.