-
Notifications
You must be signed in to change notification settings - Fork 52
132 lines (115 loc) · 3.72 KB
/
ci.yml
File metadata and controls
132 lines (115 loc) · 3.72 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
name: Build and Test
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-24.04
env:
LLVM_VERSION: 21
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set environment variables
run: |
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${{ github.workspace }}/local/lib" >> $GITHUB_ENV
echo "PATH=${{ github.workspace }}/local/bin:$PATH" >> $GITHUB_ENV
echo "LDFLAGS=-L${{ github.workspace }}/local/lib" >> $GITHUB_ENV
## TMPDIR
TMPDIR=$HOME/tmp
echo "TMPDIR=$TMPDIR" >> $GITHUB_ENV
mkdir -p $TMPDIR
- name: Print Envs
run: |
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
echo "LDFLAGS=$LDFLAGS"
echo "PATH=$PATH"
echo "TMPDIR=$TMPDIR"
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwxgtk3.2-dev \
libboost-all-dev \
tcl8.6-dev \
libedit-dev \
libsqlite3-dev \
sqlite3 \
libxerces-c-dev \
g++ \
make \
latex2html \
libffi-dev \
autoconf \
automake \
libtool \
subversion \
git \
cmake \
graphviz \
bc \
ghdl iverilog \
python3 ninja-build pkg-config libglib2.0-dev \
libpixman-1-dev libslirp-dev flex bison file device-tree-compiler \
zlib1g-dev libfdt-dev python3-tomli \
gcc-riscv64-unknown-elf
sudo apt-get purge -y 'llvm-*' 'clang-*' 'libllvm-*' 'lld-*'
- name: Create workspace directory
run: |
mkdir -p ${{ github.workspace }}/local
- name: Restore LLVM cache
id: llvm-cache-restore
uses: actions/cache/restore@v4
with:
path: |
${{ github.workspace }}/local
key: ${{ runner.os }}-llvm-${{ hashFiles('openasip/tools/scripts/install_llvm_${{ env.LLVM_VERSION }}.sh') }}
- name: Install LLVM
run: |
if [[ "${{ steps.llvm-cache-restore.outputs.cache-hit }}" != "true" ]]; then
echo "Cache not found. Installing LLVM..."
cd openasip
./tools/scripts/install_llvm_${{ env.LLVM_VERSION }}.sh ${{ github.workspace }}/local
else
echo "Cache hit! LLVM ${{ env.LLVM_VERSION }} is already installed, skipping installation."
fi
- name: Save LLVM cache
id: llvm-cache-save
uses: actions/cache/save@v4
with:
path: ${{ github.workspace }}/local
key: ${{ steps.llvm-cache-restore.outputs.cache-primary-key }}
- name: Compile and install
run: |
cd openasip
./autogen.sh
./configure --prefix=${{ github.workspace }}/local
make -j$(nproc)
make install
- name: install QEMU-OpenASIP
run: |
cd openasip
python3 ./tools/scripts/install_qemu.py $HOME/qemu-openasip
- name: Run tests
run: |
cd openasip
./tools/scripts/compiletest.sh -c
- name: Dump logs
run: |
cd openasip
if [ -f compiletest.error.log ]; then
echo "compiletest.error.log:"
cat compiletest.error.log
fi
if [ -f systemtest/differences.txt ]; then
echo "systemtest/differences.txt"
cat systemtest/differences.txt
fi
if [ -f systemtest_long/differences.txt ]; then
cat systemtest_long/differences.txt
fi