Add alpine unittests to ci #4
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: Unittests on alpine | |
on: | |
pull_request: | |
branches-ignore: | |
- 'ubuntu/**' | |
push: | |
branches: | |
- main | |
concurrency: | |
group: 'ci-${{ github.workflow }}-${{ github.ref }}' | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: sh -ex {0} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install incus | |
run: | | |
curl https://pkgs.zabbly.com/get/incus-stable | sudo sh -x | |
- name: Reset the firewall | |
run: | | |
sudo nft flush ruleset | |
- name: Init incus | |
run: sudo incus admin init --auto | |
- name: Create alpine container | |
run: | | |
groups | |
whoami | |
ls -la /var/lib/incus/unix.socket | |
useradd -G incus-admin $(whoami) | |
incus launch images:alpine/edge alpine | |
incus exec alpine -- apk install python3-tox git | |
incus exec alpine -- git clone --branch ${GITHUB_REF_NAME} https://github.com/${GITHUB_REPOSITORY}.git | |
incus exec alpine -- tox -e py3 --root ~/cloud-init |