Skip to content

Commit c4aa28e

Browse files
authored
Merge pull request pact-foundation#304 from YOU54F/test/pact-2.0.1
Update pact-go v1 to use latest pact-ruby-standalone (ruby 3.2 + arm64 support)
2 parents 1668622 + 852836e commit c4aa28e

File tree

7 files changed

+269
-219
lines changed

7 files changed

+269
-219
lines changed

.cirrus.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
test_task_template: &TEST_TASK_TEMPLATE
2+
modules_cache:
3+
fingerprint_script: cat go.sum
4+
folder: $GOPATH/pkg/mod
5+
deps_script: make deps
6+
clean_script: make clean
7+
bin_script: make bin
8+
test_script: make test
9+
10+
linux_test_task:
11+
env:
12+
matrix:
13+
- VERSION: 1.17
14+
- VERSION: 1.18
15+
name: Tests (Go $VERSION)
16+
container:
17+
image: golang:$VERSION
18+
<<: *TEST_TASK_TEMPLATE
19+
20+
linux_arm64_test_task:
21+
env:
22+
matrix:
23+
- VERSION: 1.17
24+
- VERSION: 1.18
25+
name: Tests (Go $VERSION)
26+
arm_container:
27+
image: golang:$VERSION
28+
<<: *TEST_TASK_TEMPLATE
29+
30+
macos_arm64_test_task:
31+
macos_instance:
32+
image: ghcr.io/cirruslabs/macos-ventura-base:latest
33+
pre_req_script: brew install gox
34+
<<: *TEST_TASK_TEMPLATE
35+
36+
lint_task:
37+
name: GolangCI Lint
38+
container:
39+
image: golangci/golangci-lint:latest
40+
run_script: golangci-lint run -v --out-format json > lint-report.json
41+
always:
42+
golangci_artifacts:
43+
path: lint-report.json
44+
type: text/json
45+
format: golangci

.github/workflows/golangci-lint.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@ name: golangci-lint
22
on:
33
push:
44
tags:
5-
- v1*
5+
- v2*
66
branches:
7-
- v1.x.x
7+
- master
8+
- main
89
pull_request:
910
jobs:
1011
golangci:
1112
name: lint
1213
strategy:
14+
fail-fast: false
1315
matrix:
1416
go-version: [
1517
1.17.x,
1618
1.18.x,
17-
# 1.19.x
19+
1.19.x
1820
]
1921
os: [ubuntu-latest]
2022
runs-on: ${{ matrix.os }}

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
FROM golang:1.18
22

33
# Install pact ruby standalone binaries
4-
RUN curl -LO https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v1.88.78/pact-1.88.78-linux-x86_64.tar.gz; \
5-
tar -C /usr/local -xzf pact-1.88.78-linux-x86_64.tar.gz; \
6-
rm pact-1.88.78-linux-x86_64.tar.gz
4+
RUN curl -LO https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v2.0.3/pact-2.0.3-linux-x86_64.tar.gz; \
5+
tar -C /usr/local -xzf pact-2.0.3-linux-x86_64.tar.gz; \
6+
rm pact-2.0.3-linux-x86_64.tar.gz
77

88
ENV PATH /usr/local/pact/bin:$PATH
99

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ docker:
1414
bin:
1515
gox -os="darwin" -arch="amd64" -output="build/pact-go_{{.OS}}_{{.Arch}}"
1616
gox -os="darwin" -arch="arm64" -output="build/pact-go_{{.OS}}_{{.Arch}}"
17+
gox -os="windows" -arch="amd64" -output="build/pact-go_{{.OS}}_{{.Arch}}"
1718
gox -os="windows" -arch="386" -output="build/pact-go_{{.OS}}_{{.Arch}}"
18-
gox -os="linux" -arch="386" -output="build/pact-go_{{.OS}}_{{.Arch}}"
1919
gox -os="linux" -arch="amd64" -output="build/pact-go_{{.OS}}_{{.Arch}}"
20+
gox -os="linux" -arch="arm64" -output="build/pact-go_{{.OS}}_{{.Arch}}"
2021
@echo "==> Results:"
2122
ls -hl build/
2223

@@ -34,6 +35,8 @@ install:
3435
echo "--- 🐿 Installing Pact CLI dependencies"; \
3536
curl -fsSL https://raw.githubusercontent.com/pact-foundation/pact-ruby-standalone/master/install.sh | bash -x; \
3637
fi
38+
# NOTE: pins pact-ruby-standalone to a fixed version
39+
# curl -fsSL https://raw.githubusercontent.com/pact-foundation/pact-ruby-standalone/master/install.sh | tag=v2.0.3 bash -x; \
3740
3841
publish_pacts:
3942
@echo "\n========== STAGE: publish pacts ==========\n"

0 commit comments

Comments
 (0)