Repository navigation
128 lines (111 loc) · 3.3 KB
/
Copy pathbuild.yml
File metadata and controls
128 lines (111 loc) · 3.3 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: build
on:
push:
branches:
- main
pull_request:
merge_group:
schedule:
- cron: '0 1 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
lint:
# the scheduled builds only pick up new releases, the code is already linted
if: github.event_name != 'schedule'
runs-on: ubuntu-slim
timeout-minutes: 10
permissions:
contents: read
checks: write # shellcheck annotations
env:
# node and pnpm come from the setup action, so `mise exec` must not
# install them again
MISE_EXEC_AUTO_INSTALL: 'false'
steps:
- name: ⚙️ Setup
uses: containerbase/internal-tools/setup@2082203142ae62859ac4a86919258077c6460403 # v5.3.12
with:
save-cache: true
- run: pnpm oxfmt
- name: Install the workflow linters
uses: jdx/mise-action@6be3c7ed4c21d4f76b208d351d95aac273ebb76d # v5.2.4
with:
install_args: jactionlint shellcheck zizmor
- name: Check workflow files
run: mise exec -- jactionlint --color
- name: Run zizmor
run: mise exec -- zizmor --format github .github/
env:
GH_TOKEN: ${{ github.token }}
- name: shellcheck
if: ${{ github.event_name != 'merge_group' }}
uses: reviewdog/action-shellcheck@d0b8d5fd7fad6afdb6e1b6ce1778892be4d1f427 # v1.34.1
with:
fail_level: any
reporter: github-pr-annotations
filter_mode: nofilter
path: |
bin
.husky
pattern: |
*.sh
exclude: |
./.git/*
./.husky/_/*
check_all_files_with_shebangs: 'true'
build:
needs:
- lint
# also run when lint was skipped on schedule
if: ${{ !cancelled() && !failure() }}
runs-on: ${{ matrix.arch.os }}
timeout-minutes: 60
name: build (${{ matrix.distro }}, ${{ matrix.arch.name }})
permissions:
contents: write
strategy:
matrix:
distro:
- focal
- jammy
arch:
- name: x86_64
os: ubuntu-24.04
- name: aarch64
os: ubuntu-24.04-arm
env:
DISTRO: ${{ matrix.distro }} # build target, name required by binary-builder
ARCH: ${{ matrix.arch.name }} # build target, name required by binary-builder
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
show-progress: false
- name: binary-builder
uses: containerbase/internal-tools@2082203142ae62859ac4a86919258077c6460403 # v5.3.12
with:
command: binary-builder
dry-run: ${{github.ref != 'refs/heads/main'}}
token: ${{ secrets.GITHUB_TOKEN }}
success:
runs-on: ubuntu-slim
needs:
- lint
- build
timeout-minutes: 1
if: always()
steps:
- name: Fail for failed or cancelled build
if: |
needs.build.result == 'failure' ||
needs.build.result == 'cancelled'
run: exit 1
- name: Fail for failed or cancelled lint
if: |
needs.lint.result == 'failure' ||
needs.lint.result == 'cancelled'
run: exit 1