Merge pull request #893 from mwhudson/github-actions

switch to github actions
This commit is contained in:
Michael Hudson-Doyle 2021-02-19 09:13:59 +13:00 committed by GitHub
commit bcc0e5c1f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 26 deletions

24
.github/workflows/build.yaml vendored Normal file
View File

@ -0,0 +1,24 @@
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
image:
- ubuntu-daily:bionic
- ubuntu-daily:focal
- ubuntu-daily:groovy
- ubuntu-daily:hirsute
steps:
- uses: actions/checkout@v2
- name: run
run: sudo ./scripts/test-in-lxd.sh ${{ matrix.image }} ./scripts/runtests.sh
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: lint
run: sudo ./scripts/test-in-lxd.sh ubuntu-daily:focal "make lint"

View File

@ -1,13 +0,0 @@
sudo: required
dist: xenial
env:
- IMAGE=ubuntu-daily:bionic SCRIPT="make lint"
- IMAGE=ubuntu-daily:bionic SCRIPT=./scripts/runtests.sh
- IMAGE=ubuntu-daily:focal SCRIPT=./scripts/runtests.sh
- IMAGE=ubuntu-daily:groovy SCRIPT=./scripts/runtests.sh
language: bash
script:
- sudo ./scripts/test-in-lxd.sh "$IMAGE" "$SCRIPT"

View File

@ -1,7 +1,5 @@
#!/bin/bash
set -eux
# Enable proposed
cat /etc/apt/sources.list | sed -n 's/-updates/-proposed/p' > /etc/apt/sources.list.d/proposed.list
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade
mkdir -p /etc/systemd/system/zfs-mount.service.d/
@ -13,6 +11,6 @@ ConditionPathExists=/sys/module/zfs
EOF
cp -r /etc/systemd/system/zfs-mount.service.d/ /etc/systemd/system/zfs-share.service.d/
systemctl daemon-reload
apt-get install -y --no-install-recommends libnl-3-dev libnl-genl-3-dev libnl-route-3-dev libsystemd-dev python3-distutils-extra pkg-config python3.5 python3-pip git lsb-release python3-setuptools gcc python3-dev python3-wheel curtin pep8 python3-pyflakes python3-bson
apt-get install -y --no-install-recommends libnl-3-dev libnl-genl-3-dev libnl-route-3-dev libsystemd-dev python3-distutils-extra pkg-config python3.5 python3-pip git lsb-release python3-setuptools gcc python3-dev python3-wheel curtin pep8 python3-pyflakes python3-bson make
pip3 install -r requirements.txt
python3 setup.py build

View File

@ -21,6 +21,8 @@ clean () {
rm -rf .subiquity/run/
}
tty=$(tty) || tty=/dev/console
export SUBIQUITY_REPLAY_TIMESCALE=100
for answers in examples/answers*.yaml; do
clean
@ -29,7 +31,7 @@ for answers in examples/answers*.yaml; do
config=examples/simple.json
fi
# The --foreground is important to avoid subiquity getting SIGTTOU-ed.
timeout --foreground 60 sh -c "LANG=C.UTF-8 python3 -m subiquity.cmd.tui --answers $answers --dry-run --snaps-from-examples --machine-config $config"
timeout --foreground 60 sh -c "LANG=C.UTF-8 python3 -m subiquity.cmd.tui --answers $answers --dry-run --snaps-from-examples --machine-config $config" < $tty
validate
done

View File

@ -3,15 +3,7 @@ set -eux
IMAGE=$1
SCRIPT=$2
apt-get -qq update
apt install -y lxd
sed -i 's/LXD_IPV4_ADDR=".*"/LXD_IPV4_ADDR="192.168.123.1"/' /etc/default/lxd-bridge
sed -i 's/LXD_IPV4_NETMASK=".*"/LXD_IPV4_NETMASK="255.255.255.0"/' /etc/default/lxd-bridge
sed -i 's/LXD_IPV4_NETWORK=".*"/LXD_IPV4_NETWORK="192.168.123.0\/24"/' /etc/default/lxd-bridge
sed -i 's/LXD_IPV4_DHCP_RANGE=".*"/LXD_IPV4_DHCP_RANGE="192.168.123.2,192.168.123.12"/' /etc/default/lxd-bridge
sed -i 's/LXD_IPV4_DHCP_MAX=".*"/LXD_IPV4_DHCP_MAX="10"/' /etc/default/lxd-bridge
sed -i 's/LXD_IPV6_PROXY=".*"/LXD_IPV6_PROXY="false"/' /etc/default/lxd-bridge
snap install lxd --channel=3.0/stable
lxd init --auto
service lxd restart