From f7d3a8170e4393d95118cb8e61bbee1ee7a47100 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Thu, 25 Jul 2024 14:40:16 +0100 Subject: [PATCH] ci(win): add windows gha runner / setup download dir, CGO_FLAGS and PATH to pact_ffi.dll --- .github/workflows/test.yml | 13 ++++++++++++- Makefile | 10 +++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f347f2844..e6b289a98 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -43,6 +43,15 @@ 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 @@ -50,8 +59,10 @@ jobs: 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: diff --git a/Makefile b/Makefile index c8ade19d7..0a6582e20 100755 --- a/Makefile +++ b/Makefile @@ -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. @@ -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"; \ @@ -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"