Skip to content

Commit f7d3a81

Browse files
committed
ci(win): add windows gha runner / setup download dir, CGO_FLAGS and PATH to pact_ffi.dll
1 parent de76480 commit f7d3a81

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

.github/workflows/test.yml

+12-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
1.21.x,
2626
1.22.x,
2727
]
28-
os: [ubuntu-latest, macos-12, macos-14]
28+
os: [ubuntu-latest, macos-12, macos-14, windows-latest]
2929
runs-on: ${{ matrix.os }}
3030
steps:
3131
- name: Checkout code
@@ -43,15 +43,26 @@ jobs:
4343
- name: Test
4444
if: matrix.os == 'ubuntu-latest'
4545
run: APP_BRANCH=${APP_REF:11} DOCKER_GATEWAY_HOST=172.17.0.1 DOCKER_HOST_HTTP="http://172.17.0.1" make
46+
- name: Set CGO_LDFLAGS / pact_ffi lib on PATH
47+
if: matrix.os == 'windows-latest'
48+
run: |
49+
"CGO_LDFLAGS=-L$env:TMP" >> $env:GITHUB_ENV
50+
"$env:TMP" >> $env:GITHUB_PATH
51+
- name: Skip Avro plugin & test (windows)
52+
if: matrix.os == 'windows-latest'
53+
run: |
54+
"SKIP_PLUGIN_AVRO=1" >> $env:GITHUB_ENV
4655
- name: Test (unit)
4756
if: matrix.os != 'ubuntu-latest'
4857
run: make test
4958
- name: Test (pact)
5059
if: matrix.os != 'ubuntu-latest'
5160
run: make pact_local
5261
- name: Install goveralls
62+
if: matrix.os != 'windows-latest'
5363
run: go install github.com/mattn/goveralls@latest
5464
- name: Send coverage
65+
if: matrix.os != 'windows-latest'
5566
run: goveralls -coverprofile=coverage.txt -service=github -parallel
5667
- uses: actions/upload-artifact@v4
5768
with:

Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ PLUGIN_PACT_AVRO_VERSION=0.0.5
1111

1212
GO_VERSION?=1.22
1313
ci:: docker deps clean bin test pact
14+
PACT_DOWNLOAD_DIR=/tmp
15+
ifeq ($(OS),Windows_NT)
16+
PACT_DOWNLOAD_DIR=$$TMP
17+
endif
1418

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

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

6969
download_plugins:
7070
@echo "--- 🐿 Installing plugins"; \
@@ -106,7 +106,7 @@ cli:
106106

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

111111
pact: clean install docker
112112
@echo "--- 🔨 Running Pact examples"

0 commit comments

Comments
 (0)