-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (56 loc) · 1.95 KB
/
ci.yml
File metadata and controls
64 lines (56 loc) · 1.95 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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
gcc-version: [9, 11]
steps:
- uses: actions/checkout@v2
- name: Install GCC ${{ matrix.gcc-version }}
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y gcc-${{ matrix.gcc-version }} g++-${{ matrix.gcc-version }}
echo "CC=gcc-${{ matrix.gcc-version }}" >> $GITHUB_ENV
echo "CXX=g++-${{ matrix.gcc-version }}" >> $GITHUB_ENV
- name: Install GCC ${{ matrix.gcc-version }}
if: matrix.os == 'macos-latest'
run: |
brew install gcc@${{ matrix.gcc-version }}
echo "CC=gcc-${{ matrix.gcc-version }}" >> $GITHUB_ENV
echo "CXX=g++-${{ matrix.gcc-version }}" >> $GITHUB_ENV
- name: Build Plugin
run: make
- name: Build Runtime
run: |
gcc -Iinclude -c runtime/ternary_runtime.c -o ternary_runtime.o
- name: Run Tests
run: |
cd tests
chmod +x run_tests.sh
./run_tests.sh
# Compile ABI test
gcc -I../include -c test_abi.c -o test_abi.o
gcc test_abi.o ../runtime/ternary_runtime.o -o test_abi
./test_abi
# Compile promotion test
gcc -fplugin=../ternary_plugin.so -fplugin-arg-ternary_plugin-types -I../include -c test_promotion.c -o test_promotion.o
gcc test_promotion.o -o test_promotion
./test_promotion
# Sanity check
gcc -c test_no_ternary.c -o test_no_ternary.o
# Run benchmark
gcc -I../include -c benchmark.c -o benchmark.o
gcc benchmark.o ../runtime/ternary_runtime.o -o benchmark
./benchmark
# Edge cases
gcc -I../include -c test_edge_cases.c -o test_edge_cases.o
gcc test_edge_cases.o ../runtime/ternary_runtime.o -o test_edge_cases
./test_edge_cases