@@ -14,27 +14,45 @@ jobs:
14
14
RM_TS_DIR : " /tmp/rmlint-unit-testdir"
15
15
steps :
16
16
- uses : actions/checkout@v4
17
+ with :
18
+ fetch-depth : 0
19
+
20
+ - name : " Check changes"
21
+ # TODO also include skipping build but allow docs to be processed
22
+ run : |
23
+ if git diff --exit-code --name-only origin/master . ':!.gitignore' ':!docs' ':!*.md' ':!*.txt' ':!*.yml'; then
24
+ echo "SKIP_CHANGES=false" >> "$GITHUB_ENV"
25
+ else
26
+ echo "SKIP_CHANGES=true" >> "$GITHUB_ENV"
27
+ fi
28
+
17
29
- name : " Prepare build environment"
18
30
run : |
19
- sudo apt update
20
- sudo apt install -y --no-install-recommends \
31
+ sudo apt-get update
32
+ sudo apt-get install -y --no-install-recommends \
21
33
scons python3-sphinx gettext python3-setuptools \
22
34
libblkid-dev libelf-dev libglib2.0-dev libjson-glib-dev \
23
35
clang python3-pip python3-cffi python3-dev libffi-dev
24
36
pip3 install -r tests/requirements.txt
37
+
25
38
- name : " Build"
26
39
# Todo: eventually run tests with valgrind (RM_TS_USE_VALGRIND)
27
40
# Todo enable slow tests in pytest
28
41
run : |
29
42
scons config
30
43
scons VERBOSE=1 DEBUG=1 O=release
44
+
31
45
- name : " Prepare test environment"
46
+ # TODO Ignore linter warning. See https://github.com/github/vscode-github-actions/issues/222
47
+ if : ${{ env.SKIP_CHANGES == 'true' }}
32
48
# The test suite is seriously disk-intensive. Given that linux
33
49
# instances hosted in GitHub have 16G of RAM available we will
34
50
# use it to speed up the run.
35
51
run : |
36
52
sudo mkdir "${RM_TS_DIR}"
37
53
sudo mount -o size=12G,nr_inodes=0 -t tmpfs tmpfs "${RM_TS_DIR}"
38
- - name : " Test"
54
+
55
+ - name : " Test it"
56
+ if : ${{ env.SKIP_CHANGES == 'true' }}
39
57
run : |
40
58
RM_TS_PRINT_CMD=1 RM_TS_PEDANTIC=0 python -m pytest -s -v
0 commit comments