Skip to content

Commit

Permalink
Merge pull request #304 from YOU54F/test/pact-2.0.1
Browse files Browse the repository at this point in the history
Update pact-go v1 to use latest pact-ruby-standalone (ruby 3.2 + arm64 support)
  • Loading branch information
mefellows authored Jul 18, 2023
2 parents 1668622 + 852836e commit c4aa28e
Show file tree
Hide file tree
Showing 7 changed files with 269 additions and 219 deletions.
45 changes: 45 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
test_task_template: &TEST_TASK_TEMPLATE
modules_cache:
fingerprint_script: cat go.sum
folder: $GOPATH/pkg/mod
deps_script: make deps
clean_script: make clean
bin_script: make bin
test_script: make test

linux_test_task:
env:
matrix:
- VERSION: 1.17
- VERSION: 1.18
name: Tests (Go $VERSION)
container:
image: golang:$VERSION
<<: *TEST_TASK_TEMPLATE

linux_arm64_test_task:
env:
matrix:
- VERSION: 1.17
- VERSION: 1.18
name: Tests (Go $VERSION)
arm_container:
image: golang:$VERSION
<<: *TEST_TASK_TEMPLATE

macos_arm64_test_task:
macos_instance:
image: ghcr.io/cirruslabs/macos-ventura-base:latest
pre_req_script: brew install gox
<<: *TEST_TASK_TEMPLATE

lint_task:
name: GolangCI Lint
container:
image: golangci/golangci-lint:latest
run_script: golangci-lint run -v --out-format json > lint-report.json
always:
golangci_artifacts:
path: lint-report.json
type: text/json
format: golangci
8 changes: 5 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@ name: golangci-lint
on:
push:
tags:
- v1*
- v2*
branches:
- v1.x.x
- master
- main
pull_request:
jobs:
golangci:
name: lint
strategy:
fail-fast: false
matrix:
go-version: [
1.17.x,
1.18.x,
# 1.19.x
1.19.x
]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM golang:1.18

# Install pact ruby standalone binaries
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; \
tar -C /usr/local -xzf pact-1.88.78-linux-x86_64.tar.gz; \
rm pact-1.88.78-linux-x86_64.tar.gz
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; \
tar -C /usr/local -xzf pact-2.0.3-linux-x86_64.tar.gz; \
rm pact-2.0.3-linux-x86_64.tar.gz

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

Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ docker:
bin:
gox -os="darwin" -arch="amd64" -output="build/pact-go_{{.OS}}_{{.Arch}}"
gox -os="darwin" -arch="arm64" -output="build/pact-go_{{.OS}}_{{.Arch}}"
gox -os="windows" -arch="amd64" -output="build/pact-go_{{.OS}}_{{.Arch}}"
gox -os="windows" -arch="386" -output="build/pact-go_{{.OS}}_{{.Arch}}"
gox -os="linux" -arch="386" -output="build/pact-go_{{.OS}}_{{.Arch}}"
gox -os="linux" -arch="amd64" -output="build/pact-go_{{.OS}}_{{.Arch}}"
gox -os="linux" -arch="arm64" -output="build/pact-go_{{.OS}}_{{.Arch}}"
@echo "==> Results:"
ls -hl build/

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

0 comments on commit c4aa28e

Please sign in to comment.