-
Notifications
You must be signed in to change notification settings - Fork 4
70 lines (55 loc) · 1.85 KB
/
pr-check.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
name: Pull Request Check
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
BUILD_TYPE: Release
LLVM_VERSION: 16.0
jobs:
build:
strategy:
matrix:
os: [ "ubuntu-22.04", "macos-14" ]
backend: [ "llvm", "pcode" ]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Build
env:
BUILD_TYPE: ${{env.BUILD_TYPE}}
run: bash ./scripts/build.sh ${{matrix.backend}}
- name: Unit test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
test:
needs: build
strategy:
matrix:
os: [ "ubuntu-22.04", "macos-14" ]
stage: [ "llvm", "pcode", "mips" ]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Install llvm
if: ${{ matrix.stage == 'llvm' }}
uses: KyleMayes/install-llvm-action@v2
with:
version: ${{env.LLVM_VERSION}}
- name: Setup llvm environment for macos
if: ${{ matrix.stage == 'llvm' && contains(matrix.os, 'macos') }}
run: |
LLVM_PATH=${{ env.LLVM_PATH }}
LLVM_VERSION=${{ env.LLVM_VERSION }}
echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV
echo "CPATH=$LLVM_PATH/lib/clang/$LLVM_VERSION/include/" >> $GITHUB_ENV
echo "LDFLAGS=-L$LLVM_PATH/lib" >> $GITHUB_ENV
echo "CPPFLAGS=-I$LLVM_PATH/include" >> $GITHUB_ENV
echo "CC=$LLVM_PATH/bin/clang" >> $GITHUB_ENV
echo "CXX=$LLVM_PATH/bin/clang++" >> $GITHUB_ENV
- name: Install mars emulator for mips
if: matrix.stage == 'mips'
run: wget https://courses.missouristate.edu/KenVollmar/MARS/MARS_4_5_Aug2014/Mars4_5.jar -O ${{github.workspace}}/mars.jar
- name: Run test script
run: python ./scripts/test.py -s ${{matrix.stage}} -d ${{github.workspace}}/testcases