-
Notifications
You must be signed in to change notification settings - Fork 4
77 lines (72 loc) · 2.83 KB
/
linux.yml
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
on:
push:
branches:
- main
pull_request:
jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: shellcheck --color=always --shell=bash --exclude=SC2086,SC2059,SC2046,SC2235,SC2002,SC2206,SC2068,SC2207,SC2013 *.sh activate
test:
runs-on: ubuntu-latest
strategy:
matrix:
llvm-version: [11, 13]
# Testing all levels because there was a bug that only happened with -O1. (#224)
opt-level: ['-O0', '-O1', '-O2', '-O3']
steps:
- uses: actions/checkout@v3
- run: sudo apt install -y llvm-${{ matrix.llvm-version }}-dev clang-${{ matrix.llvm-version }} make valgrind
- run: LLVM_CONFIG=llvm-config-${{ matrix.llvm-version }} make
- run: ./runtests.sh --verbose --jou-flags "${{ matrix.opt-level }}"
- run: ./runtests.sh --verbose --jou-flags "${{ matrix.opt-level }} --verbose"
# Valgrinding is slow, but many files affect valgrind results.
# We skip it when all changes are to .md files (docs, README etc)
- name: Figure out if we need to run tests with valgrind
id: check-need-valgrind
run: |
git fetch https://github.com/Akuli/jou main
# Find modified non-markdown files. If there are any, set doit=yes.
if git diff --name-only FETCH_HEAD HEAD | grep -vE '\.md$'; then
echo doit=yes >> $GITHUB_OUTPUT
else
echo doit=no >> $GITHUB_OUTPUT
fi
- if: ${{ steps.check-need-valgrind.outputs.doit == 'yes' }}
run: ./runtests.sh --verbose --valgrind --jou-flags "${{ matrix.opt-level }}"
# valgrind+verbose isn't meaningful: test script would ignore valgrind output
- run: make clean
- name: Check that "make clean" deleted all files not committed to Git
run: |
if [ "$(git status --porcelain --ignored)" != "" ]; then
git status --ignored
exit 1
fi
doctest:
runs-on: ubuntu-latest
strategy:
matrix:
llvm-version: [11, 13]
steps:
- uses: actions/checkout@v3
- run: sudo apt install -y llvm-${{ matrix.llvm-version }}-dev clang-${{ matrix.llvm-version }} make
- run: LLVM_CONFIG=llvm-config-${{ matrix.llvm-version }} make
- run: ./doctest.sh
compare-compilers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sudo apt install -y llvm-13-dev clang-13 make valgrind
- run: LLVM_CONFIG=llvm-config-13 make
- run: ./compare_compilers.sh
editorconfig-checker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Hard-coded commit, because the latest changes aren't tagged.
- uses: editorconfig-checker/action-editorconfig-checker@d4fca16fc71adef10fbe101903b654449fa9570c
with:
version: 2.7.0
- run: editorconfig-checker