Skip to content

Add alpine unittests to ci #7

Add alpine unittests to ci

Add alpine unittests to ci #7

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
sudo usermod -a -G incus-admin $(whoami)
groups
whoami
newgrp incus-admin
groups
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