-
Notifications
You must be signed in to change notification settings - Fork 8
94 lines (86 loc) · 3.02 KB
/
Copy pathci.yml
File metadata and controls
94 lines (86 loc) · 3.02 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
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
shellcheck:
name: shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install shellcheck
run: |
sudo apt-get update
sudo apt-get install -y shellcheck
shellcheck --version
- name: Run shellcheck
run: |
set -e
# -x: follow `shellcheck source=` directives (entrypoint.sh sources lib.sh).
shellcheck -x entrypoint.sh lib.sh
shellcheck tests/contract.sh
shellcheck tests/smoke.sh
actionlint:
name: actionlint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
# rhysd/actionlint is a Go binary, not a JavaScript action. We install
# it directly from the upstream release instead of using a wrapper
# action, which keeps the dependency footprint small and the version
# pin explicit.
- name: Install actionlint
run: |
set -e
ver=1.7.7
curl -sSL -o /tmp/actionlint.tar.gz \
"https://github.com/rhysd/actionlint/releases/download/v${ver}/actionlint_${ver}_linux_amd64.tar.gz"
tar -xzf /tmp/actionlint.tar.gz -C /tmp actionlint
sudo mv /tmp/actionlint /usr/local/bin/actionlint
actionlint --version
- name: Run actionlint
run: actionlint -color
hadolint:
name: hadolint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
# Pin to a specific tag because the upstream has no floating "v3" ref
# (only v3.0.0, v3.1.0, ...). Using `@v3` makes the resolver fail.
- uses: hadolint/hadolint-action@2332a7b74a6de0dda2e2221d575162eba76ba5e5 # v3.3.0
with:
dockerfile: Dockerfile
# DL3018 (pin apk versions) is a real concern but fixing it is
# out of scope for this PR — it will be addressed alongside
# the image digest pinning work. Treat as info for now.
failure-threshold: error
contract:
name: Contract test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Verify action.yml ↔ entrypoint.sh/lib.sh consistency
run: tests/contract.sh
unit:
name: Unit tests (bats)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install bats
run: |
sudo apt-get update
sudo apt-get install -y bats
bats --version
- name: Run bats unit tests for lib.sh
run: bats tests/unit
smoke:
name: Smoke tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Run entrypoint.sh smoke tests in alpine
run: tests/smoke.sh