-
Notifications
You must be signed in to change notification settings - Fork 6
114 lines (107 loc) · 3.04 KB
/
angr-ci.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
name: angr CI
on:
workflow_call:
inputs:
nightly:
description: "Enable nightly-only tests"
default: false
type: boolean
required: false
container_image:
description: "Container image to use"
default: "angr/ci:3"
type: string
required: false
afl:
description: "Set AFL parameters during test stage"
default: false
type: boolean
required: false
jobs:
build:
name: Build
runs-on: ubuntu-22.04
container:
image: ${{ inputs.container_image }}
steps:
- run: /root/scripts/ga-build.sh
name: Build CI artifact
env:
NIGHTLY: ${{ inputs.nightly }}
- uses: actions/upload-artifact@v4
with:
name: build_archive
path: ./build.tar.zst
compression-level: 0
lint:
name: Lint
runs-on: ubuntu-22.04
container:
image: ${{ inputs.container_image }}
needs: build
steps:
- uses: actions/download-artifact@v4
with:
name: build_archive
- run: /root/scripts/ga-lint.sh
name: Run linter
typecheck:
name: Typecheck
runs-on: ubuntu-22.04
container:
image: ${{ inputs.container_image }}
needs: build
steps:
- uses: actions/download-artifact@v4
with:
name: build_archive
- run: /root/scripts/ga-typecheck.sh
name: Run type checker
test:
name: Test
runs-on: ubuntu-22.04
container:
image: ${{ inputs.container_image }}
options: -v /var/run/docker.sock:/var/run/docker.sock -v /proc:/hostproc --cap-add=SYS_PTRACE --security-opt seccomp:unconfined
needs: build
strategy:
fail-fast: false
matrix:
worker: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
steps:
- run: |
echo 1 | tee /hostproc/sys/kernel/sched_child_runs_first
echo core | tee /hostproc/sys/kernel/core_pattern
name: Set AFL parameters
if: ${{ inputs.afl }}
- uses: actions/download-artifact@v4
with:
name: build_archive
- run: /root/scripts/ga-test.sh
name: Run tests
env:
WORKER: ${{ matrix.worker }}
NUM_WORKERS: 10
- uses: actions/upload-artifact@v4
if: always()
with:
name: Test Results ${{ matrix.worker }}
path: build/results/*.tests.xml
publish-test-results:
name: "Publish Unit Tests Results"
needs: test
runs-on: ubuntu-latest
if: always()
steps:
- name: Send result email
if: inputs.nightly && needs.test.result == 'failure'
env:
MAILGUN_API_TOKEN: ${{ secrets.MAILGUN_API_TOKEN }}
run: |
BUILD_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
curl -s --user "api:$MAILGUN_API_TOKEN" \
https://api.mailgun.net/v3/mail.rev.fish/messages \
-F from="angr Nightly CI <[email protected]>" \
-F [email protected] \
-F subject="$GITHUB_REPOSITORY nightly CI failed" \
-F text="Link to failed run: $BUILD_URL"