-
Notifications
You must be signed in to change notification settings - Fork 98
48 lines (41 loc) · 1.52 KB
/
pr-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
# See reference docs at
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: Pull request CI
on: pull_request
jobs:
pr-ci:
runs-on: ubuntu-22.04
steps:
- name: Clone the repo
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Check if container files was modified and if container version already exists
id: checks
run: |
./.ci/check-container-sources-modified >> "$GITHUB_OUTPUT"
./.ci/check-container-version-published >> "$GITHUB_OUTPUT"
- name: Set up QEMU for Docker
if: steps.checks.outputs.modified == 'true'
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: docker-image
if: steps.checks.outputs.modified == 'true'
uses: docker/setup-buildx-action@v3
- name: Build container image
if: steps.checks.outputs.modified == 'true'
env:
BUILDX_BUILDER: ${{ steps.docker-image.outputs.name }}
run: |
if "${{ steps.checks.outputs.container-published }}" == "true"; then
echo "::error::Container modified but version $(cat .containerversion) already published"
exit 1
fi
./.ci/build-container
- name: Pull container image
run: ./.ci/pull-container
- name: Run CI in container
env:
COMPARE_REV: ${{ format('origin/{0}', github.base_ref) }}
run: ./.ci/run-container-ci ${{github.workspace}}