-
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (36 loc) · 974 Bytes
/
Copy pathmain.yml
File metadata and controls
45 lines (36 loc) · 974 Bytes
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
name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
permissions:
contents: read
jobs:
ci:
name: Lint, Format, Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install shellcheck
run: |
sudo apt-get update
sudo apt-get install -y shellcheck
- name: Install shfmt
run: |
SHFMT_VERSION=v3.8.0
curl -fsSL -o /tmp/shfmt \
"https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/shfmt_${SHFMT_VERSION}_linux_amd64"
chmod +x /tmp/shfmt
sudo mv /tmp/shfmt /usr/local/bin/shfmt
shfmt --version
- name: Install bats
run: |
sudo apt-get install -y bats
- name: Lint (shellcheck)
run: make lint
- name: Format check (shfmt -d)
run: make fmt-check
- name: Tests (bats)
run: make test