Skip to content

Commit

Permalink
ci: use native Ubuntu python for tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
  • Loading branch information
sergiusens committed Jul 10, 2024
1 parent ccba428 commit 6b86188
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 30 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/tics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,25 @@ on:
push:
branches:
- main
# to easy test changes to the workflow
- tiobe

jobs:
CI:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install dependencies
run: |
echo "::group::apt-get update"
sudo apt-get update
echo "::endgroup::"
echo "::group::apt-get install..."
sudo apt-get install -y libapt-pkg-dev libyaml-dev xdelta3 patchelf
sudo apt-get install -y python3 python3-dev libapt-pkg-dev libyaml-dev xdelta3 patchelf
echo "::endgroup::"
echo "::group::pip install"
python -m pip install 'tox<5.0' tox-gh
Expand Down
30 changes: 7 additions & 23 deletions .github/workflows/tox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,12 @@ on:

jobs:
linters:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
echo "::group::Begin snap install"
Expand All @@ -31,7 +27,7 @@ jobs:
sudo apt-get update
echo "::endgroup::"
echo "::group::apt-get install..."
sudo apt-get install --yes libapt-pkg-dev libyaml-dev xdelta3
sudo apt-get install --yes python3 python3-dev libapt-pkg-dev libyaml-dev xdelta3
echo "::endgroup::"
echo "::group::pip install"
python -m pip install 'tox<5.0' tox-gh
Expand All @@ -48,39 +44,27 @@ jobs:
- name: Run Linters
run: tox run --colored yes --skip-pkg-install -m lint
tests:
strategy:
fail-fast: false # Run all the tests to their conclusions.
matrix:
platform: [ubuntu-22.04]
python_version: ["3.10"]
include:
- python_version: "3.10"
tox_python: py310
runs-on: ${{ matrix.platform }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python version ${{ matrix.python_version }} on ${{ matrix.platform }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
echo "::group::apt-get update"
sudo apt-get update
echo "::endgroup::"
echo "::group::apt-get install..."
sudo apt-get install -y libapt-pkg-dev libyaml-dev xdelta3
sudo apt-get install -y python3 python3-dev libapt-pkg-dev libyaml-dev xdelta3
echo "::endgroup::"
echo "::group::pip install"
python -m pip install 'tox<5.0' tox-gh
echo "::endgroup::"
mkdir -p results
- name: Setup Tox environments
run: tox run-parallel --parallel auto --parallel-no-spinner --parallel-live --colored yes -e test-${{ matrix.tox_python }},test-legacy-${{ matrix.tox_python }} --notest
run: tox run-parallel --parallel auto --parallel-no-spinner --parallel-live --colored yes -e test-py310,test-legacy-py310 --notest
- name: Test with tox
run: tox run --skip-pkg-install --result-json results/tox-${{ matrix.platform }}.json --colored yes -e test-${{ matrix.tox_python }},test-legacy-${{ matrix.tox_python }}
run: tox run --skip-pkg-install --result-json results/tox-ubuntu-22.04.json --colored yes -e test-py310,test-legacy-py310
- name: Upload code coverage
uses: codecov/codecov-action@v3
with:
Expand All @@ -90,5 +74,5 @@ jobs:
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.platform }}
name: test-results-ubuntu-22.04
path: results/

0 comments on commit 6b86188

Please sign in to comment.