Repository navigation
59 lines (52 loc) · 2.08 KB
/
Copy pathci.yml
File metadata and controls
59 lines (52 loc) · 2.08 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
# CI (C6.5). Releasing lives in release.yml, on its own tag trigger — this
# workflow never publishes. Keeping the two apart is what lets the release
# gate on `make check` without either workflow having to know the other's
# schedule. Actions are SHA-pinned (C6.5); bump the SHA and the trailing
# version comment together.
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: DeterminateSystems/nix-installer-action@e50d5f73bfe71c2dd0aa4218de8f4afa59f8f81d # v16
- run: nix develop --command make lint
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: DeterminateSystems/nix-installer-action@e50d5f73bfe71c2dd0aa4218de8f4afa59f8f81d # v16
- run: nix develop --command make test
nix-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: DeterminateSystems/nix-installer-action@e50d5f73bfe71c2dd0aa4218de8f4afa59f8f81d # v16
- run: nix build
# Build-only, not executed — no native darwin runner; cross-compilation
# means the linux runner is sufficient.
cross-compile:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- { os: darwin, arch: arm64 }
- { os: linux, arch: amd64 }
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: DeterminateSystems/nix-installer-action@e50d5f73bfe71c2dd0aa4218de8f4afa59f8f81d # v16
- name: build ${{ matrix.target.os }}/${{ matrix.target.arch }}
run: |
nix develop --command env \
CGO_ENABLED=0 GOOS=${{ matrix.target.os }} GOARCH=${{ matrix.target.arch }} \
go build -o dist/clast-${{ matrix.target.os }}-${{ matrix.target.arch }} ./cmd/clast