-
Notifications
You must be signed in to change notification settings - Fork 43
44 lines (44 loc) · 1.57 KB
/
continuous-integration.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
name: Continuous Integration
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
continuous-integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build the tests docker container
uses: docker/[email protected]
with:
tags: jstockwin/py-pdf-parser-test:test
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
load: true
# This ugly bit is necessary if you don't want your cache to grow forever
# till it hits GitHub's limit of 5GB.
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Run test
run: | # Note we need '-uroot' so user has permissions to github.workspace
docker run --rm -uroot --volume ${{ github.workspace }}:/py-pdf-parser \
jstockwin/py-pdf-parser-test:test .github/scripts/test.sh
- name: Check docs build correctly
run: docker run --rm jstockwin/py-pdf-parser-test:test .github/scripts/docs.sh