Add alpine unittests to ci #1
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: Integration Tests | |
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: | |
integration-tests: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Prepare test tools | |
run: | | |
sudo DEBIAN_FRONTEND=noninteractive apt-get -y update | |
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install incus | |
- name: Initialize LXD | |
run: | | |
ssh-keygen -P "" -q -f ~/.ssh/id_rsa | |
# Jammy GH Action runners have docker installed, which edits iptables | |
# in a way that is incompatible with lxd. | |
# https://documentation.ubuntu.com/lxd/en/latest/howto/network_bridge_firewalld/#prevent-connectivity-issues-with-lxd-and-docker | |
sudo iptables -I DOCKER-USER -j ACCEPT | |
sudo incus init --auto | |
- name: Create alpine container | |
run: | | |
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 |