-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (120 loc) · 4.44 KB
/
Copy pathci.yml
File metadata and controls
139 lines (120 loc) · 4.44 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
136
137
138
139
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.96.0
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --check
- run: cargo build --bin ion-lsp
- run: cargo test
- run: cargo clippy -- -D warnings
- run: cargo build --release --bin ion-compiler --bin ion-lsp --bin ion-build
- run: ./target/release/ion-compiler --version
- run: ./target/release/ion-build --version
- name: Integration tests (Linux)
shell: bash
env:
COMPILER: ${{ github.workspace }}/target/release/ion-compiler
ION_BUILD: ${{ github.workspace }}/target/release/ion-build
run: cd tests && bash test_runner.sh
- name: Generated C sanitizer smoke (Linux)
shell: bash
env:
COMPILER: ${{ github.workspace }}/target/release/ion-compiler
CC: gcc
CFLAGS: -fsanitize=address,undefined -fno-omit-frame-pointer
LDFLAGS: -fsanitize=address,undefined
ASAN_OPTIONS: detect_leaks=0
UBSAN_OPTIONS: halt_on_error=1
run: |
cd tests
"$CC" $CFLAGS -c ../runtime/ion_runtime.c -I. -I.. -I../runtime -o .ion_test_runtime_san.o
while IFS=' ' read -r test expected; do
"$COMPILER" "$test.ion" >/dev/null
"$CC" $CFLAGS "$test.c" .ion_test_runtime_san.o -I. -I.. -I../runtime -lpthread $LDFLAGS -o "$test"
set +e
"./$test" >/dev/null
status=$?
set -e
if [ "$status" -ne "$expected" ]; then
echo "$test: expected exit $expected, got $status"
exit 1
fi
rm -f "$test.c" "$test"
done <<'EOF'
test_basic 42
test_vec_push_pop 0
test_string_push_byte 79
test_spawn_channel 0
test_array_to_slice_coercion 10
EOF
- name: Generated C thread sanitizer (Linux)
shell: bash
env:
COMPILER: ${{ github.workspace }}/target/release/ion-compiler
CC: gcc
CFLAGS: -fsanitize=thread -fno-omit-frame-pointer
LDFLAGS: -fsanitize=thread
run: |
cd tests
"$CC" $CFLAGS -c ../runtime/ion_runtime.c -I. -I.. -I../runtime -o .ion_test_runtime_tsan.o
while IFS=$'\t' read -r test kind expected _rest; do
[ "$kind" = "run" ] || continue
case "$test" in
test_channel_*|test_spawn_*) ;;
*) continue ;;
esac
[ -f "${test}.ion" ] || continue
"$COMPILER" "${test}.ion" >/dev/null
"$CC" $CFLAGS "${test}.c" .ion_test_runtime_tsan.o -I. -I.. -I../runtime -lpthread $LDFLAGS -o "$test"
set +e
"./$test" >/dev/null
status=$?
set -e
if [ "$status" -ne "$expected" ]; then
echo "$test: expected exit $expected, got $status"
exit 1
fi
rm -f "${test}.c" "$test"
done < <(awk -F '\t' 'NR > 1 && $2 == "run" && ($1 ~ /^test_channel_/ || $1 ~ /^test_spawn_/) { print $1, $2, $3 }' test_expectations.tsv)
- name: Large codegen smoke (Linux)
shell: bash
env:
COMPILER: ${{ github.workspace }}/target/release/ion-compiler
CC: gcc
CFLAGS: -Wall -Wextra -Werror
run: bash tests/large_codegen_smoke.sh
- name: Generated C warning-clean (Linux)
shell: bash
env:
COMPILER: ${{ github.workspace }}/target/release/ion-compiler
ION_BUILD: ${{ github.workspace }}/target/release/ion-build
CC: gcc
CFLAGS: -Wall -Wextra -Werror
RUNTIME_OBJ: .ion_test_runtime_werror.o
run: cd tests && bash test_runner.sh
integration:
permissions:
contents: read
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.96.0
- uses: Swatinem/rust-cache@v2
- run: cargo build --release --bin ion-compiler --bin ion-build
- name: Integration tests (Windows)
shell: bash
env:
COMPILER: ${{ github.workspace }}/target/release/ion-compiler
ION_BUILD: ${{ github.workspace }}/target/release/ion-build
run: cd tests && bash test_runner.sh