Repository navigation
73 lines (68 loc) · 1.82 KB
/
Copy pathci.yml
File metadata and controls
73 lines (68 loc) · 1.82 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
name: CI
on:
pull_request:
push:
branches: [main]
workflow_call:
inputs:
ref:
description: Revision to verify
type: string
required: true
outputs:
sha:
description: Exact commit verified by all jobs
value: ${{ jobs.lint.outputs.sha }}
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ inputs.ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
lint:
name: lint
runs-on: ubuntu-latest
outputs:
sha: ${{ steps.revision.outputs.sha }}
steps:
- uses: actions/checkout@v7
with:
ref: ${{ inputs.ref || github.sha }}
- id: revision
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- uses: jdx/mise-action@v4
with:
cache: true
- uses: actions/cache@v6
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/.cache/golangci-lint
key: ${{ runner.os }}-lint-${{ hashFiles('mise.toml', 'go.sum') }}
restore-keys: ${{ runner.os }}-lint-
- run: task check:versions deps lint
- run: task release:check
test:
name: test (${{ matrix.os }})
needs: lint
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v7
with:
ref: ${{ needs.lint.outputs.sha }}
- uses: jdx/mise-action@v4
with:
cache: true
- uses: actions/cache@v6
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('mise.toml', 'go.sum') }}
restore-keys: ${{ runner.os }}-go-
- run: task check:versions build vet test test:scripts