-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (82 loc) · 2.63 KB
/
Copy pathci.yml
File metadata and controls
87 lines (82 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
go:
name: go vet + test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: go vet
run: go vet ./...
- name: go test
run: go test ./...
compat:
name: compat (CONTRACT machine-attestation)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: resolve compat dependency
# The compat module lives at github.com/quantcli/common/compat
# under a subpath. `go mod tidy` materializes go.sum for it on
# first run; subsequent runs are cache-served.
run: go mod tidy
- name: build liftoff-export
run: go build -o /tmp/liftoff-export .
- name: run compat suite
env:
# Path the compat-tagged test reads from os.Getenv.
LIFTOFF_EXPORT_BIN: /tmp/liftoff-export
run: go test -tags=compat -run TestContractFormats ./...
artifacts:
# Cross-compile review binaries for the platforms reviewers actually use.
# Goreleaser owns tagged releases; this job exists so a PR's diff can be
# tried end-to-end without a local Go toolchain.
#
# One artifact per platform, not one bundle: the PR comment links each
# artifact directly, and a Windows user shouldn't download 33MB of Linux
# and macOS binaries to get their 6MB .exe.
name: review binary (${{ matrix.goos }}/${{ matrix.goarch }})
runs-on: ubuntu-latest
strategy:
matrix:
include:
- { goos: darwin, goarch: arm64 }
- { goos: darwin, goarch: amd64 }
- { goos: linux, goarch: amd64 }
- { goos: linux, goarch: arm64 }
- { goos: windows, goarch: amd64, ext: .exe }
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: cross-compile
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
mkdir -p dist
go build -trimpath -ldflags="-s -w" \
-o "dist/liftoff-export-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.ext }}" .
ls -lh dist/
- uses: actions/upload-artifact@v4
with:
name: liftoff-export-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/
retention-days: 14
if-no-files-found: error