-
Notifications
You must be signed in to change notification settings - Fork 45
99 lines (80 loc) · 2.26 KB
/
build.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
name: Build
on:
workflow_dispatch: {}
push:
branches:
- "master"
tags:
- "*"
pull_request:
branches:
- "*"
jobs:
build_linux:
runs-on: ubuntu-22.04
timeout-minutes: 32
steps:
- name: Clone polytracker repository
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and export
uses: docker/build-push-action@v4
with:
context: .
tags: trailofbits/polytracker:latest
outputs: type=docker,dest=/tmp/polytracker.tar
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: polytracker docker image
path: /tmp/polytracker.tar
run_tests:
needs: build_linux
runs-on: ubuntu-22.04
timeout-minutes: 32
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: polytracker docker image
path: /tmp
- name: Load image
run: docker load --input /tmp/polytracker.tar
- name: Run tests
uses: addnab/docker-run-action@v3
with:
image: trailofbits/polytracker:latest
run: pytest /polytracker/tests
build_example:
needs: build_linux
strategy:
matrix:
example: [mupdf, poppler, qpdf]
runs-on: ubuntu-22.04
timeout-minutes: 32
steps:
- name: Clone polytracker repository
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 1
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: polytracker docker image
path: /tmp
- name: Load image
run: docker load --input /tmp/polytracker.tar
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build ${{ matrix.example }}
uses: docker/build-push-action@v4
with:
context: examples
file: examples/Dockerfile-${{ matrix.example }}.demo
tags: trailofbits/polytracker-demo-${{ matrix.example }}:latest
outputs: type=image,name=trailofbits/polytracker-demo-${{ matrix.example }}:latest