Repository navigation
105 lines (98 loc) · 2.8 KB
/
Copy pathci.yml
File metadata and controls
105 lines (98 loc) · 2.8 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
name: CI
on:
push:
paths:
- 'bin/**'
- 'lib/**'
- 'extras/**'
- 'tests/**'
- '.github/workflows/ci.yml'
pull_request:
paths:
- 'bin/**'
- 'lib/**'
- 'extras/**'
- 'tests/**'
- '.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_common.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: bash tests/test_common.sh
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