-
Notifications
You must be signed in to change notification settings - Fork 6
134 lines (127 loc) · 3.71 KB
/
build-test.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
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
# Funcheck - A tool for checking functions calls return protections
# Copyright (C) 2023 Theo Matis
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
name: Build & test
on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]
# compile library keep the output
# compile host and keep the output
# run the tests using the host and library
# do it in separate jobs so that we can see the output of each
# keep it in cache
jobs:
build-libfuncheck:
name: Build libfuncheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Make lib
run: make -C library
- name: Upload libfuncheck.so
uses: actions/upload-artifact@v3
with:
name: libfuncheck.so
path: library/libfuncheck.so
build-funcheck:
name: Build funcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Make host
run: make -C host
- name: Upload funcheck
uses: actions/upload-artifact@v3
with:
name: funcheck
path: host/funcheck
test:
name: Run tests
runs-on: ubuntu-latest
needs: [build-libfuncheck, build-funcheck]
steps:
- uses: actions/checkout@v3
- name: Get libfuncheck.so
uses: actions/download-artifact@v3
with:
name: libfuncheck.so
path: library
- name: Get funcheck
uses: actions/download-artifact@v3
with:
name: funcheck
path: host
- name: enable execution
run: chmod +x host/funcheck
- name: Setup node 19.7
uses: actions/setup-node@v2
with:
node-version: '19.7'
- name: install llvm
run: sudo apt-get install llvm
- name: Install yarn
run: npm install -g yarn
- name: Install dependencies
uses: borales/actions-yarn@v4
with:
cmd: install
dir: 'e2e'
- name: Run tests
uses: borales/actions-yarn@v4
with:
cmd: test
dir: 'e2e'
release:
name: Publish artifacts
runs-on: ubuntu-latest
needs: [test]
if: github.event_name == 'release'
# content write and read are needed for the changelog
permissions:
contents: write
pull-requests: read
steps:
- uses: actions/checkout@v3
- name: Get libfuncheck.so
uses: actions/download-artifact@v3
with:
name: libfuncheck.so
path: library
- name: Get funcheck
uses: actions/download-artifact@v3
with:
name: funcheck
path: host
- name: upload libfuncheck.so
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: library/libfuncheck.so
asset_name: libfuncheck.so
tag: ${{ github.ref }}
overwrite: true
- name: upload funcheck
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: host/funcheck
asset_name: funcheck
tag: ${{ github.ref }}
overwrite: true