-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (88 loc) · 3.05 KB
/
checks.yml
File metadata and controls
107 lines (88 loc) · 3.05 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: checks
env:
HOMEBREW_NO_ANALYTICS: '1'
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
group: checks-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
# If your repo has a go.mod, this will pick the version from it.
go-version-file: go.mod
cache: true
- name: Cache Homebrew downloads
id: brew_dl
uses: actions/cache@v4
with:
path: |
~/.cache/Homebrew
key: brew-cache-${{ runner.os }}-${{ hashFiles('Brewfile') }}
restore-keys: |
brew-cache-${{ runner.os }}-
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@main
- name: Detect Homebrew prefix
id: brew
run: echo "prefix=$(brew --prefix)" >> "$GITHUB_OUTPUT"
- name: Cache Homebrew installation
id: brew_install
uses: actions/cache@v4
with:
path: |
${{ steps.brew.outputs.prefix }}/Cellar
${{ steps.brew.outputs.prefix }}/opt
${{ steps.brew.outputs.prefix }}/bin
${{ steps.brew.outputs.prefix }}/sbin
${{ steps.brew.outputs.prefix }}/lib
${{ steps.brew.outputs.prefix }}/include
${{ steps.brew.outputs.prefix }}/share
${{ steps.brew.outputs.prefix }}/etc
${{ steps.brew.outputs.prefix }}/var
${{ steps.brew.outputs.prefix }}/Homebrew/Library/Taps
key: brew-install-${{ runner.os }}-${{ hashFiles('Brewfile') }}
restore-keys: |
brew-install-${{ runner.os }}-
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Get Node version
id: nodever
run: echo "v=$(node -v)" >> "$GITHUB_OUTPUT"
- name: Restore node_modules
id: nodemod
uses: actions/cache@v4
with:
path: node_modules
key: node-mod-${{ runner.os }}-${{ steps.nodever.outputs.v }}-${{ hashFiles('package-lock.json') }}
- name: Install deps (only on cache miss)
if: steps.nodemod.outputs.cache-hit != 'true'
run: npm ci --no-audit --no-fund
- name: Save node_modules (optional; actions/cache auto-saves on miss)
if: steps.nodemod.outputs.cache-hit != 'true'
uses: actions/cache@v4
with:
path: node_modules
key: node-mod-${{ runner.os }}-${{ steps.nodever.outputs.v }}-${{ hashFiles('package-lock.json') }}
- name: Install Homebrew tools (only if cache miss)
if: steps.brew_install.outputs.cache-hit != 'true'
run: brew bundle --no-upgrade --file=Brewfile
- name: Self-install
run: go run bootstrap.go
- name: Parallelism check
run: stave parallelismcheck
- name: Project init (CI-safe)
run: stave init
- name: Run tests
run: stave test