-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (50 loc) · 1.68 KB
/
tests.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
# This workflow checks that the contents of the PR are ready for
# publishing as soon as they land in `main`. Most importantly it
# checks that a new version number has been assigned as part of the
# change and it's basically consistent with our release policy.
name: Check that a PR is ready for merge to main
on:
pull_request:
branches: [main]
merge_group:
env:
GITHUB_BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha}}
GITHUB_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
src:
- 'Dockerfile'
# run only if Dockerfile was changed
- if: steps.changes.outputs.src == 'true'
name: Check version number consistency
run: ./scripts/check-pr.sh
- name: Set up QEMU for Docker
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Cache docker build artifacts
uses: actions/cache@v4
with:
path: |
/tmp/buildx-cache/
key: docker-buildx-${{ hashFiles('./Makefile', './Dockerfile', './scripts/*') }}
restore-keys: |
docker-buildx-
- name: Check that the images can be built and used
run: make test
- name: Only keep the latest images in docker cache
run: |
rm -rf /tmp/buildx-cache
mv /tmp/buildx-cache-new /tmp/buildx-cache