-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |