Skip to content

Commit

Permalink
Merge pull request #2163 from Chris-Peterson444/actions-ubuntu-20.04-…
Browse files Browse the repository at this point in the history
…deprecations

ci: migrate actions runners off ubuntu 20.04
  • Loading branch information
Chris-Peterson444 authored Feb 21, 2025
2 parents 619a0a5 + 7a2dace commit 8951f33
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 10 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
test:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand All @@ -20,10 +20,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: run
run: sudo ./scripts/test-in-lxd.sh ${{ matrix.image }} "make check"
run: |
sudo ./scripts/github-ci-lxd-setup.sh
sudo ./scripts/test-in-lxd.sh ${{ matrix.image }} "make check"
lint:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand All @@ -33,18 +35,20 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: lint
run: sudo ./scripts/test-in-lxd.sh ${{ matrix.image }} "make lint"
run: |
sudo ./scripts/github-ci-lxd-setup.sh
sudo ./scripts/test-in-lxd.sh ${{ matrix.image }} "make lint"
format-black:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: psf/black@stable
with:
version: "~= 23.0"
src: "console_conf subiquity subiquitycore"
format-isort:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: isort/isort-action@v1
Expand All @@ -54,7 +58,7 @@ jobs:
static-typing:
# In this job, we compare the output of mypy before and after the PR.
if: github.event_name == 'pull_request'
runs-on: ubuntu-22.04 # minimimum 22.04 for python3-typeshed
runs-on: ubuntu-24.04
steps:
- name: Install mypy and typeshed
run: sudo apt-get install -y python3-mypy python3-typeshed
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cla-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [pull_request]

jobs:
cla-check:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Check if CLA signed
uses: canonical/has-signed-canonical-cla@v2
2 changes: 1 addition & 1 deletion .github/workflows/snap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
snap-build:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: canonical/action-build@v1
23 changes: 23 additions & 0 deletions scripts/github-ci-lxd-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -eux

# The purpose of this script is to separate out the actions needed to setup
# LXD on the GitHub Actions CI runners from the actual test setup and
# execution. This way, test scripts can be mostly run locally without making
# too many changes to the local system.

# The runner images don't have lxd enabled by default.
lxd init --auto

# If the runner image uses docker, then work around a known connectivity issue
# when using lxd and docker at the same time.
# https://discuss.linuxcontainers.org/t/containers-do-not-have-outgoing-internet-access/10844/7
# https://documentation.ubuntu.com/lxd/en/latest/howto/network_bridge_firewalld/#prevent-connectivity-issues-with-lxd-and-docker
if [ "active" == "$(systemctl is-active docker)" ]
then
iptables -I DOCKER-USER -i lxdbr0 -j ACCEPT
iptables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
# GitHub doesn't use IPV6 (yet?)
# ip6tables -I DOCKER-USER -i lxdbr0 -j ACCEPT
# ip6tables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
fi
1 change: 0 additions & 1 deletion scripts/test-in-lxd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ IMAGE=$1
TEST_CMD=$2
TESTER=subiquity-${IMAGE##*:}

lxd init --auto

if [ -z "$(lxc list -f csv -c n ^${TESTER}\$)" ]
then
Expand Down

0 comments on commit 8951f33

Please sign in to comment.