-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/upstreams/develop' into merge
- Loading branch information
Showing
619 changed files
with
29,127 additions
and
32,888 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
|
||
name: Alpine Unittests | ||
|
||
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" | ||
uses: actions/checkout@v4 | ||
with: | ||
# Fetch all tags for tools/read-version | ||
fetch-depth: 0 | ||
|
||
- name: Setup LXD | ||
uses: canonical/[email protected] | ||
with: | ||
channel: latest/candidate | ||
|
||
- name: Create alpine container | ||
# the current shell doesn't have lxd as one of the groups | ||
# so switch groups to run lxd commands | ||
run: lxc launch images:alpine/edge alpine | ||
|
||
- name: Check networking (for debugging) | ||
run: | | ||
lxc exec alpine -- ping -c 1 google.com || true | ||
lxc exec alpine -- ping -c 1 dl-cdn.alpinelinux.org || true | ||
lxc exec alpine -- nslookup www.google.com || true | ||
lxc exec alpine -- ping -c 1 dl-cdn.alpinelinux.org || true | ||
- name: Install dependencies | ||
run: lxc exec alpine -- apk add py3-tox git tzdata | ||
|
||
- name: Mount source into container directory | ||
run: lxc config device add alpine gitdir disk source=$(pwd) path=/root/cloud-init-ro | ||
|
||
- name: Create a r/w directory to run tests in | ||
# without this, tox fails during package install | ||
run: | | ||
lxc exec alpine -- git config --global --add safe.directory /root/cloud-init-ro/.git | ||
lxc exec alpine -- git clone cloud-init-ro cloud-init-rw | ||
- name: Set a timezone | ||
# test for regression of GH-5158 | ||
# https://github.com/canonical/cloud-init/issues/5158 | ||
run: lxc exec alpine -- ln -s /usr/share/zoneinfo/Europe/Brussels /etc/localtime | ||
|
||
- name: Set up tox environment | ||
# Setup the environment and then tell pytest to do essentially nothing | ||
run: lxc exec alpine --cwd /root/cloud-init-rw -- tox -e py3 -- --cache-show= | ||
|
||
- name: Stop network | ||
# Take down network interfaces to ensure tests don't use network | ||
run: lxc exec alpine -- ifdown -a | ||
|
||
- name: Run unittests | ||
run: lxc exec alpine --cwd /root/cloud-init-rw -- tox -e py3 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,11 +18,8 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
env: [ruff, mypy, pylint, black, isort] | ||
lint-with: | ||
- {tip-versions: false, os: ubuntu-20.04} | ||
- {tip-versions: true, os: ubuntu-latest} | ||
name: Check ${{ matrix.lint-with.tip-versions && 'tip-' || '' }}${{ matrix.env }} | ||
runs-on: ${{ matrix.lint-with.os }} | ||
name: Check ${{ matrix.env }} | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: "Checkout #1" | ||
uses: actions/[email protected] | ||
|
@@ -41,17 +38,10 @@ jobs: | |
run: python3 --version | ||
|
||
- name: Test | ||
if: ${{ !matrix.lint-with.tip-versions }} | ||
env: | ||
# matrix env: not to be confused w/environment variables or testenv | ||
TOXENV: ${{ matrix.env }} | ||
run: tox | ||
- name: Test (tip versions) | ||
if: matrix.lint-with.tip-versions | ||
continue-on-error: true | ||
env: | ||
TOXENV: tip-${{ matrix.env }} | ||
run: tox | ||
schema-format: | ||
strategy: | ||
fail-fast: false | ||
|
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
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
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
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
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
Oops, something went wrong.