Skip to content

Commit

Permalink
ci: split test jobs for faster checks
Browse files Browse the repository at this point in the history
Considering the most recent runs, this reduces the total amount of time
it takes to run the tests from about 9-10 minutes to about 3 minutes.

Note: Which jobs are split is mostly determined by how long each test
takes.
  • Loading branch information
kmk3 committed Aug 16, 2023
1 parent ec96c1f commit 497a47a
Showing 1 changed file with 169 additions and 14 deletions.
183 changes: 169 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,175 @@ on:
permissions: # added using https://github.com/step-security/secure-workflows
contents: read

#
# Faster tests
#

jobs:
test:
test-main:
runs-on: ubuntu-22.04
env:
SHELL: /bin/bash
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: block
allowed-endpoints: >
azure.archive.ubuntu.com:80
github.com:443
packages.microsoft.com:443
ppa.launchpadcontent.net:443
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: update package information
run: sudo apt-get update -qy
- name: install dependencies
run: >
sudo apt-get install -qy
gcc-12 libapparmor-dev libselinux1-dev expect xzdec bridge-utils
- name: print env
run: ./ci/printenv.sh
- name: configure
run: >
CC=gcc-12 ./configure --prefix=/usr --enable-fatal-warnings
--enable-analyzer --enable-apparmor --enable-selinux
|| (cat config.log; exit 1)
- name: make
run: make -j "$(nproc)"
- name: make install
run: sudo make install
- name: print firejail version
run: command -V firejail && firejail --version
- run: make lab-setup
- run: make test-seccomp-extra
- run: make test-firecfg
- run: make test-capabilities
- run: make test-apparmor
- run: make test-appimage
- run: make test-chroot
- run: make test-fcopy

#
# Slower tests
#

test-fs:
runs-on: ubuntu-22.04
env:
SHELL: /bin/bash
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: block
allowed-endpoints: >
azure.archive.ubuntu.com:80
github.com:443
packages.microsoft.com:443
ppa.launchpadcontent.net:443
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: update package information
run: sudo apt-get update -qy
- name: install dependencies
run: >
sudo apt-get install -qy
gcc-12 libapparmor-dev libselinux1-dev expect xzdec bridge-utils
- name: print env
run: ./ci/printenv.sh
- name: configure
run: >
CC=gcc-12 ./configure --prefix=/usr --enable-fatal-warnings
--enable-analyzer --enable-apparmor --enable-selinux
|| (cat config.log; exit 1)
- name: make
run: make -j "$(nproc)"
- name: make install
run: sudo make install
- name: print firejail version
run: command -V firejail && firejail --version
- run: make lab-setup
- run: make test-private-etc
- run: make test-fs

test-environment:
runs-on: ubuntu-22.04
env:
SHELL: /bin/bash
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: block
allowed-endpoints: >
azure.archive.ubuntu.com:80
github.com:443
packages.microsoft.com:443
ppa.launchpadcontent.net:443
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: update package information
run: sudo apt-get update -qy
- name: install dependencies
run: >
sudo apt-get install -qy
gcc-12 libapparmor-dev libselinux1-dev expect xzdec bridge-utils
- name: print env
run: ./ci/printenv.sh
- name: configure
run: >
CC=gcc-12 ./configure --prefix=/usr --enable-fatal-warnings
--enable-analyzer --enable-apparmor --enable-selinux
|| (cat config.log; exit 1)
- name: make
run: make -j "$(nproc)"
- name: make install
run: sudo make install
- name: print firejail version
run: command -V firejail && firejail --version
- run: make lab-setup
- run: make test-environment
- run: make test-profiles

test-utils:
runs-on: ubuntu-22.04
env:
SHELL: /bin/bash
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: block
allowed-endpoints: >
azure.archive.ubuntu.com:80
debian.org:80
github.com:443
packages.microsoft.com:443
ppa.launchpadcontent.net:443
www.debian.org:443
www.debian.org:80
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: update package information
run: sudo apt-get update -qy
- name: install dependencies
run: >
sudo apt-get install -qy
gcc-12 libapparmor-dev libselinux1-dev expect xzdec bridge-utils
- name: print env
run: ./ci/printenv.sh
- name: configure
run: >
CC=gcc-12 ./configure --prefix=/usr --enable-fatal-warnings
--enable-analyzer --enable-apparmor --enable-selinux
|| (cat config.log; exit 1)
- name: make
run: make -j "$(nproc)"
- name: make install
run: sudo make install
- name: print firejail version
run: command -V firejail && firejail --version
- run: make lab-setup
- run: make test-utils

test-network:
runs-on: ubuntu-22.04
env:
SHELL: /bin/bash
Expand Down Expand Up @@ -77,18 +244,6 @@ jobs:
- name: print firejail version
run: command -V firejail && firejail --version
- run: make lab-setup
- run: make test-seccomp-extra
- run: make test-firecfg
- run: make test-capabilities
- run: make test-apparmor
- run: make test-appimage
- run: make test-chroot
- run: make test-sysutils
- run: make test-private-etc
- run: make test-profiles
- run: make test-fcopy
- run: make test-fnetfilter
- run: make test-fs
- run: make test-utils
- run: make test-environment
- run: make test-sysutils
- run: make test-network

0 comments on commit 497a47a

Please sign in to comment.