Add GitHub Actions #2
Workflow file for this run
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
name: Test build and package QubesOS RPMs | |
on: | |
push: | |
branches: | |
- 'aem*' | |
pull_request: | |
branches: # this is to avoid running the workflow twice in a PR | |
- 'aem*' | |
jobs: | |
build-and-package: | |
runs-on: ubuntu-latest | |
name: Compile and package as QubesOS RPM | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 100 # need history for `git format-patch` | |
- name: Cache Docker image and dom0 stuff | |
uses: actions/cache@v3 | |
id: docker-cache | |
with: | |
path: | | |
/tmp/qubes-fedora-builder.tar | |
/tmp/cache/dom0.tar | |
key: ${{ hashFiles('.github/docker/*') }}-docker-container | |
- name: Load Docker image | |
if: steps.docker-cache.outputs.cache-hit == 'true' | |
run: | | |
docker load --input /tmp/qubes-fedora-builder.tar | |
- name: Build Fedora image | |
if: steps.docker-cache.outputs.cache-hit != 'true' | |
uses: docker/build-push-action@v4 | |
with: | |
tags: qubes-fedora-builder:latest | |
context: ./.github/docker | |
- name: Export Docker image | |
if: steps.docker-cache.outputs.cache-hit != 'true' | |
run: | | |
docker save --output /tmp/qubes-fedora-builder.tar \ | |
qubes-fedora-builder:latest | |
- name: Prepare dom0 cache storage | |
if: steps.docker-cache.outputs.cache-hit != 'true' | |
run: | | |
mkdir --mode=777 /tmp/cache | |
- name: Build and package | |
run: | | |
docker run --privileged \ | |
-v /tmp/cache:/tmp/cache/ \ | |
-v "$GITHUB_WORKSPACE:$GITHUB_WORKSPACE" \ | |
-w "$GITHUB_WORKSPACE" \ | |
-e "COMPONENT=vmm-xen" \ | |
-e "PATCH_START=1300" \ | |
-e "BASE_COMMIT=cbb35e72802f3a285c382a995ef647b59e5caf2f" \ | |
-e "SPEC_PATTERN=/^Patch1202:/" \ | |
qubes-fedora-builder:latest | |
- name: Save built packages | |
uses: actions/upload-artifact@v3 | |
with: | |
name: qubesos.dom0.fc37-xen-${{ github.sha }} | |
path: '*.rpm' |