Repository navigation
131 lines (124 loc) · 3.65 KB
/
Copy pathci.yml
File metadata and controls
131 lines (124 loc) · 3.65 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
129
130
131
name: CI
on:
push:
paths:
- 'bin/**'
- 'lib/**'
- 'extras/**'
- 'tests/*.sh'
- 'tests/*.py'
- '.github/workflows/ci.yml'
pull_request:
paths:
- 'bin/**'
- 'lib/**'
- 'extras/**'
- 'tests/*.sh'
- 'tests/*.py'
- '.github/workflows/ci.yml'
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
shell: ${{ steps.filter.outputs.shell }}
python: ${{ steps.filter.outputs.python }}
integration: ${{ steps.filter.outputs.integration }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
shell:
- 'bin/**'
- 'lib/atomic/common.sh'
- 'extras/pacman-wrapper'
- 'tests/test_harness.sh'
- 'tests/test_config.sh'
- 'tests/test_validate.sh'
- 'tests/test_device.sh'
- 'tests/test_space.sh'
- 'tests/test_chroot.sh'
- 'tests/test_gc.sh'
- 'tests/test_uki.sh'
- 'tests/test_home.sh'
- 'tests/test_upgrade.sh'
- 'tests/test_rebuild_uki.sh'
- '.github/workflows/ci.yml'
python:
- 'lib/atomic/fstab.py'
- 'lib/atomic/rootdev.py'
- 'tests/test_fstab.py'
- 'tests/test_rootdev.py'
- '.github/workflows/ci.yml'
integration:
- 'bin/atomic-guard'
- 'extras/pacman-wrapper'
- 'lib/atomic/common.sh'
- 'etc/atomic.conf'
- 'tests/test_integration.sh'
- '.github/workflows/ci.yml'
shellcheck:
needs: changes
if: needs.changes.outputs.shell == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: |
shellcheck -s bash -e SC1090,SC1091,SC2010,SC2034 \
bin/atomic-upgrade \
bin/atomic-gc \
bin/atomic-rebuild-uki \
lib/atomic/common.sh \
extras/pacman-wrapper
shellcheck -s bash -e SC1090,SC1091,SC2310 \
bin/atomic-guard
python-lint:
needs: changes
if: needs.changes.outputs.python == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: pip install --no-cache-dir ruff mypy
- run: ruff check lib/atomic/fstab.py lib/atomic/rootdev.py
- run: mypy --ignore-missing-imports lib/atomic/fstab.py lib/atomic/rootdev.py
python-test:
needs: changes
if: needs.changes.outputs.python == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: pip install --no-cache-dir pytest
- run: python -m pytest tests/ -v
bash-test:
needs: changes
if: needs.changes.outputs.shell == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: |
for t in \
tests/test_config.sh \
tests/test_validate.sh \
tests/test_device.sh \
tests/test_space.sh \
tests/test_chroot.sh \
tests/test_gc.sh \
tests/test_uki.sh \
tests/test_home.sh \
tests/test_upgrade.sh \
tests/test_rebuild_uki.sh; do
echo "━━━ $t ━━━"
bash "$t" || exit 1
done
integration-test:
needs: changes
if: needs.changes.outputs.integration == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: bash tests/test_integration.sh