Add .gitlab-ci.yml #825
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: Testing | |
on: | |
push: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Install Go 1.19.1 | |
uses: actions/setup-go@v1 | |
with: | |
go-version: 1.19.1 | |
- name: Install Task | |
uses: arduino/setup-task@v1 | |
- name: Install dependencies | |
run: | | |
DEBIAN_FRONTEND=noninteractive sudo apt-get -qq update | |
DEBIAN_FRONTEND=noninteractive sudo apt-get -qqy install \ | |
debootstrap systemd-container libglib2.0-dev libostree-dev | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
task deps:install | |
- name: Build default config | |
run: | | |
task config | |
- name: Generate example signing keys | |
run: | | |
task demo:keygen | |
- name: Download example OS | |
run: | | |
mkdir -p cache/debos | |
cd cache/debos | |
curl -LO https://github.com/system-transparency/example-os/releases/download/v0.1/ubuntu-focal-amd64.cpio.gz | |
curl -LO https://github.com/system-transparency/example-os/releases/download/v0.1/ubuntu-focal-amd64.vmlinuz | |
- name: Generate and sign OS Package | |
run: | | |
task demo:ospkg | |
- name: Upload example OS Package | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ospkg | |
path: out/ospkgs/* | |
retention-days: 1 | |
- name: Build network mode images | |
run: | | |
task images | |
- name: Upload network mode disk image | |
uses: actions/upload-artifact@v2 | |
with: | |
name: stboot_network_disk | |
path: out/stboot.img | |
retention-days: 1 | |
- name: Upload network mode iso image | |
uses: actions/upload-artifact@v2 | |
with: | |
name: stboot_network_iso | |
path: out/stboot.iso | |
retention-days: 1 | |
- name: Set boot mode to local | |
run: | | |
sed -i '/^ST_BOOT_MODE=network/s/^/#/g' st.config | |
sed -i '/^#ST_BOOT_MODE=local/s/^#//g' st.config | |
- name: Build local mode disk image | |
run: | | |
task disk | |
- name: Upload local mode disk image | |
uses: actions/upload-artifact@v2 | |
with: | |
name: stboot_local_disk | |
path: out/stboot.img | |
retention-days: 1 | |
- name: Set boot mode to network | |
run: | | |
sed -i '/^ST_BOOT_MODE=local/s/^/#/g' st.config | |
sed -i '/^#ST_BOOT_MODE=network/s/^#//g' st.config | |
- name: Set host config file location to efivar | |
run: | | |
sed -i '/^ST_HOST_CONFIG_LOCATION=.*/d' st.config | |
sed -i '/^ST_PROVISO_STMGR_ARGS=.*/d' st.config | |
echo 'ST_HOST_CONFIG_LOCATION="efivar"' >> st.config | |
echo 'ST_PROVISO_STMGR_ARGS="-efi -version 1 -addrMode dhcp -urls http://10.0.2.2:8080/os-pkg-example-ubuntu20.json"' >> st.config | |
- name: Build provisioning iso image | |
run: | | |
task proviso | |
- name: Build efivar network mode images | |
run: | | |
task images | |
- name: Upload provisioning iso image | |
uses: actions/upload-artifact@v2 | |
with: | |
name: provisioning_iso | |
path: out/prov.iso | |
retention-days: 1 | |
- name: Upload network mode efivar disk installations | |
uses: actions/upload-artifact@v2 | |
with: | |
name: stboot_network_efivar_disk | |
path: out/stboot.img | |
retention-days: 1 | |
- name: Upload network mode efivar iso installations | |
uses: actions/upload-artifact@v2 | |
with: | |
name: stboot_network_efivar_iso | |
path: out/stboot.iso | |
retention-days: 1 | |
run-disk-network: | |
runs-on: ubuntu-20.04 | |
needs: | |
- build | |
steps: | |
- name: Install QEMU | |
run: | | |
DEBIAN_FRONTEND=noninteractive sudo apt-get -qq update | |
DEBIAN_FRONTEND=noninteractive sudo apt-get -qqy install qemu-system-x86 | |
- name: Install Task | |
uses: arduino/setup-task@v1 | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Build default config | |
run: | | |
task config | |
- name: Download network mode disk installations | |
uses: actions/download-artifact@v2 | |
with: | |
name: stboot_network_disk | |
path: out | |
- name: Download example OS Package | |
uses: actions/download-artifact@v2 | |
with: | |
name: ospkg | |
path: out/ospkgs | |
- name: Start http server to serve OS Package | |
run: | | |
task demo:server & | |
- name: Boot stboot disk in network mode using QEMU | |
run: | | |
.github/scripts/test-qemu.sh disk | |
run-iso-network: | |
runs-on: ubuntu-20.04 | |
needs: | |
- build | |
steps: | |
- name: Install QEMU | |
run: | | |
DEBIAN_FRONTEND=noninteractive sudo apt-get -qq update | |
DEBIAN_FRONTEND=noninteractive sudo apt-get -qqy install qemu-system-x86 | |
- name: Install Task | |
uses: arduino/setup-task@v1 | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Build default config | |
run: | | |
task config | |
- name: Download network mode iso installations | |
uses: actions/download-artifact@v2 | |
with: | |
name: stboot_network_iso | |
path: out | |
- name: Download example OS Package | |
uses: actions/download-artifact@v2 | |
with: | |
name: ospkg | |
path: out/ospkgs | |
- name: Start http server to serve OS Package | |
run: | | |
task demo:server & | |
- name: Boot stboot iso in network mode using QEMU | |
run: | | |
.github/scripts/test-qemu.sh iso | |
run-disk-efivar: | |
runs-on: ubuntu-20.04 | |
needs: | |
- build | |
steps: | |
- name: Install QEMU | |
run: | | |
DEBIAN_FRONTEND=noninteractive sudo apt-get -qq update | |
DEBIAN_FRONTEND=noninteractive sudo apt-get -qqy install qemu-system-x86 | |
- name: Install Task | |
uses: arduino/setup-task@v1 | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Build default config | |
run: | | |
task config | |
- name: Download provisioning iso image | |
uses: actions/download-artifact@v2 | |
with: | |
name: provisioning_iso | |
path: out | |
- name: Download network mode efivar disk installations | |
uses: actions/download-artifact@v2 | |
with: | |
name: stboot_network_efivar_disk | |
path: out | |
- name: Download example OS Package | |
uses: actions/download-artifact@v2 | |
with: | |
name: ospkg | |
path: out/ospkgs | |
- name: Start http server to serve OS Package | |
run: | | |
task demo:server & | |
- name: Provision host configuration using QEMU | |
run: | | |
task qemu:proviso | |
- name: Boot stboot disk in network efivar mode using QEMU | |
run: | | |
.github/scripts/test-qemu.sh disk | |
run-iso-efivar: | |
runs-on: ubuntu-20.04 | |
needs: | |
- build | |
steps: | |
- name: Install QEMU | |
run: | | |
DEBIAN_FRONTEND=noninteractive sudo apt-get -qq update | |
DEBIAN_FRONTEND=noninteractive sudo apt-get -qqy install qemu-system-x86 | |
- name: Install Task | |
uses: arduino/setup-task@v1 | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Build default config | |
run: | | |
task config | |
- name: Download provisioning iso image | |
uses: actions/download-artifact@v2 | |
with: | |
name: provisioning_iso | |
path: out | |
- name: Download network mode efivar iso installations | |
uses: actions/download-artifact@v2 | |
with: | |
name: stboot_network_efivar_iso | |
path: out | |
- name: Download example OS Package | |
uses: actions/download-artifact@v2 | |
with: | |
name: ospkg | |
path: out/ospkgs | |
- name: Start http server to serve OS Package | |
run: | | |
task demo:server & | |
- name: Provision host configuration using QEMU | |
run: | | |
task qemu:proviso | |
- name: Boot stboot iso in network efivar mode using QEMU | |
run: | | |
.github/scripts/test-qemu.sh iso | |
run-disk-local: | |
runs-on: ubuntu-20.04 | |
needs: | |
- build | |
steps: | |
- name: Install QEMU | |
run: | | |
DEBIAN_FRONTEND=noninteractive sudo apt-get -qq update | |
DEBIAN_FRONTEND=noninteractive sudo apt-get -qqy install qemu-system-x86 | |
- name: Install Task | |
uses: arduino/setup-task@v1 | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Build default config | |
run: | | |
task config | |
- name: Download local mode disk installations | |
uses: actions/download-artifact@v2 | |
with: | |
name: stboot_local_disk | |
path: out | |
- name: Boot stboot disk in local mode using QEMU | |
run: | | |
.github/scripts/test-qemu.sh disk | |
build-ubuntu18: | |
runs-on: ubuntu-18.04 | |
steps: | |
- name: Install Go 1.17 | |
uses: actions/setup-go@v1 | |
with: | |
go-version: 1.17 | |
- name: Install Task | |
uses: arduino/setup-task@v1 | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
task deps:install | |
- name: Build default config | |
run: | | |
task config | |
- name: Generate example signing keys | |
run: | | |
task demo:keygen | |
- name: Build stboot image without ospkg | |
run: | | |
task images |