mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2025-01-12 23:37:51 +01:00
ci(github): split build job to build and then tests job.
This commit is contained in:
parent
a65ebc42b2
commit
1efb50e67e
1 changed files with 37 additions and 8 deletions
45
.github/workflows/main.yml
vendored
45
.github/workflows/main.yml
vendored
|
@ -9,10 +9,10 @@ jobs:
|
|||
matrix:
|
||||
os:
|
||||
- ubuntu-24.04
|
||||
# - ubuntu-22.04
|
||||
- ubuntu-22.04
|
||||
mode:
|
||||
- default
|
||||
# - full-system-policy
|
||||
- full-system-policy
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
|
@ -30,12 +30,10 @@ jobs:
|
|||
if [[ ${{ matrix.mode }} == full-system-policy ]]; then
|
||||
echo -e "\noverride_dh_auto_build:\n\tmake full" >> debian/rules
|
||||
fi
|
||||
VERSION="0.$(git rev-list --count HEAD)-1"
|
||||
dch --newversion="$VERSION" --urgency=medium --distribution=stable --controlmaint "Release $VERSION"
|
||||
dpkg-buildpackage -b -d --no-sign
|
||||
bash dists/build.sh dpkg
|
||||
|
||||
- name: Install apparmor.d
|
||||
run: sudo dpkg --install ../apparmor.d_*_amd64.deb || true
|
||||
run: sudo dpkg --install .pkg/apparmor.d_*_amd64.deb || true
|
||||
|
||||
- name: Reload AppArmor
|
||||
run: |
|
||||
|
@ -56,14 +54,45 @@ jobs:
|
|||
- name: Show Number of loaded profile
|
||||
run: sudo aa-status --profiled
|
||||
|
||||
- name: Install Tests dependencies
|
||||
- name: Cache the build package
|
||||
if: matrix.mode == 'default' && matrix.os == 'ubuntu-24.04'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: .pkg/apparmor.d_*_amd64.deb
|
||||
key: ${{ matrix.os }}-${{ matrix.mode }}-${{ hashFiles('.pkg/apparmor.d_*_amd64.deb') }}
|
||||
|
||||
tests:
|
||||
runs-on: ubuntu-24.04
|
||||
needs: build
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Restore the cached build package
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
fail-on-cache-miss: true
|
||||
path: .pkg/apparmor.d_*_amd64.deb
|
||||
key: ubuntu-24.04-default-${{ hashFiles('.pkg/apparmor.d_*_amd64.deb') }}
|
||||
restore-keys: |
|
||||
ubuntu-24.04-default-
|
||||
|
||||
- name: Install Tests dependencies
|
||||
run: |
|
||||
sudo apt-get update -q
|
||||
sudo apt-get install -y \
|
||||
apparmor-profiles apparmor-utils \
|
||||
bats bats-support
|
||||
|
||||
- name: Install apparmor.d
|
||||
run: |
|
||||
sudo dpkg --install .pkg/apparmor.d_*_amd64.deb || true
|
||||
sudo systemctl restart apparmor.service
|
||||
|
||||
- name: Run the bats integration tests
|
||||
if: matrix.mode == 'default' && matrix.os == 'ubuntu-24.04'
|
||||
run: |
|
||||
make bats
|
||||
|
||||
- name: Show final AppArmor logs
|
||||
run: |
|
||||
sudo aa-log -s
|
||||
|
|
Loading…
Reference in a new issue