-
Notifications
You must be signed in to change notification settings - Fork 161
135 lines (125 loc) · 4.21 KB
/
main.yml
File metadata and controls
135 lines (125 loc) · 4.21 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
132
133
134
135
name: Github Actions
on: [push, pull_request]
jobs:
host-x86:
runs-on: ubuntu-24.04
strategy:
matrix:
compiler: [gcc, clang]
architecture: [arm, riscv]
link_mode: [static]
include:
- compiler: gcc
architecture: arm
link_mode: dynamic
- compiler: clang
architecture: arm
link_mode: dynamic
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download dependencies
run: |
sudo apt-get update -q -y
sudo apt-get install -q -y graphviz jq
sudo apt-get install -q -y qemu-user
sudo apt-get install -q -y build-essential
sudo apt-get install -q -y gcc-arm-linux-gnueabihf
- name: Determine static or dynamic linking mode
id: determine-mode
run: |
if [ "${{ matrix.link_mode }}" = "dynamic" ]; then
echo "Use dynamic linking mode"
echo "DYNLINK=1" >> "$GITHUB_OUTPUT"
else
echo "Use static linking mode"
echo "DYNLINK=0" >> "$GITHUB_OUTPUT"
fi
- name: Build artifacts
env:
CC: ${{ matrix.compiler }}
run: |
make ARCH=${{ matrix.architecture }} DYNLINK=${{ steps.determine-mode.outputs.DYNLINK }}
- name: IR regression tests
run: |
make check-snapshot DYNLINK=${{ steps.determine-mode.outputs.DYNLINK }} || exit 1
- name: Sanitizer-enabled stage 0 tests
env:
CC: ${{ matrix.compiler }}
run: |
make check-sanitizer DYNLINK=${{ steps.determine-mode.outputs.DYNLINK }} || exit 1
- name: Unit tests
run: |
make check DYNLINK=${{ steps.determine-mode.outputs.DYNLINK }} || exit 1
host-arm:
runs-on: ubuntu-24.04-arm
strategy:
matrix:
link_mode: [static, dynamic]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download dependencies
run: |
sudo dpkg --add-architecture armhf
sudo apt-get update -q -y
sudo apt-get install -q -y graphviz jq
sudo apt-get install -q -y build-essential libc6:armhf
sudo wget https://github.com/fastfetch-cli/fastfetch/releases/download/2.58.0/fastfetch-linux-aarch64.deb
sudo dpkg -i fastfetch-linux-aarch64.deb
- name: Determine static or dynamic linking mode
id: determine-mode
run: |
if [ "${{ matrix.link_mode }}" = "dynamic" ]; then
echo "Use dynamic linking mode"
echo "DYNLINK=1" >> "$GITHUB_OUTPUT"
else
echo "Use static linking mode"
echo "DYNLINK=0" >> "$GITHUB_OUTPUT"
fi
- name: Build artifacts
run: |
make ARCH=arm DYNLINK=${{ steps.determine-mode.outputs.DYNLINK }}
- name: Sanitizer-enabled stage 0 tests
run: |
make check-sanitizer DYNLINK=${{ steps.determine-mode.outputs.DYNLINK }} || exit 1
- name: Unit tests
run: |
make check DYNLINK=${{ steps.determine-mode.outputs.DYNLINK }} || exit 1
preprocessor-host:
runs-on: ubuntu-24.04
strategy:
matrix:
compiler: [gcc, clang]
architecture: [arm, riscv]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download dependencies
run: |
sudo apt-get update -q -y
sudo apt-get install -q -y graphviz jq
sudo apt-get install -q -y qemu-user
sudo apt-get install -q -y build-essential
- name: Configurate config
run: |
make distclean config ARCH=${{ matrix.architecture }}
- name: Preprocess stage 1 source code
env:
CC: ${{ matrix.compiler }}
run: |
make out/shecc
./out/shecc -E src/main.c > ./out/out.c
- name: Build stage 1 artifact
run: |
./out/shecc --no-libc -o out/shecc-stage1.elf ./out/out.c
coding-style:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Coding convention
run: |
sudo apt-get install -q -y clang-format-18
.ci/check-newline.sh
.ci/check-format.sh
shell: bash