This repository was archived by the owner on Nov 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
156 lines (133 loc) · 3.75 KB
/
test.yml
File metadata and controls
156 lines (133 loc) · 3.75 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
defaults:
run:
shell: bash
jobs:
test:
name: ${{ matrix.build.name }}
runs-on: ${{ matrix.build.os }}
env:
BUILD_ENV: debug
TARGET: ${{ matrix.build.target }}
CC: ${{ matrix.build.cc }}
AR: ${{ matrix.build.ar }}
strategy:
fail-fast: false
matrix:
build:
- name: test on linux (clang)
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
cc: clang-12
ar: llvm-ar-12
zig: false
run: make tests/run
- name: test on mac (clang)
os: macos-latest
target: x86_64-apple-darwin
cc: clang
ar: ar
zig: false
run: |
$CC --version
make tests/run
- name: build for mac m1 (zig)
os: macos-latest
target: aarch64-apple-darwin
cc: zig cc --target=aarch64-macos
ar: ar
zig: true
run: |
make libruby_parser_c.a
- name: test on windows (msvc)
os: windows-latest
target: x86_64-pc-windows-msvc
cc: cl.exe
zig: false
run: |
make tests/run
- name: test on windows (mingw)
os: windows-latest
target: x86_64-pc-windows-gnu
cc: gcc
ar: ar
zig: false
run: |
gcc --version
make tests/run
- name: valgrind
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
cc: clang-12
ar: llvm-ar-12
zig: false
run: |
sudo apt-get update
sudo apt-get install -y valgrind libtool-bin
make tests/runner
valgrind ./tests/runner
- name: asan
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
cc: clang-12
ar: llvm-ar-12
zig: false
run: ASAN_OPTIONS=detect_leaks=1 CFLAGS="-fsanitize=address" make tests/run
steps:
- name: setup msvc on windows
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: ${{ matrix.build.target }}
override: true
- name: print system info
run: |
rustc --version --verbose
which make
make --version
which bash
bash --version
- name: checkout
uses: actions/checkout@v2
- name: fix link.exe on windows
if: runner.os == 'Windows'
run: rm "C:\\Program Files\\Git\\usr\\bin\\link.exe"
- name: install zig
uses: goto-bus-stop/setup-zig@v2
if: ${{ matrix.build.zig }}
- name: install cargo-zigbuild
run: cargo install cargo-zigbuild
if: ${{ matrix.build.zig }}
- name: codegen
run: make do-codegen
- name: run tests
run: ${{ matrix.build.run }}
test-header:
name: test building lib-ruby-parser.h
runs-on: ubuntu-latest
env:
TARGET: x86_64-unknown-linux-gnu
steps:
- name: install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: checkout
uses: actions/checkout@v2
- name: build lib-ruby-parser.h
run: make lib-ruby-parser.h
- name: validate lib-ruby-parser.h
run: clang -fsyntax-only -Wall -Wextra -Wpedantic lib-ruby-parser.h