summaryrefslogtreecommitdiff
path: root/.github/workflows/unit.yml
blob: 26c278d54cd5b89e36581d173f2dd401a6fc2f74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Unit Tests
on:
  pull_request:
concurrency:
  group: 'ci-${{ github.workflow }}-${{ github.ref }}'
  cancel-in-progress: true
defaults:
  run:
    shell: sh -ex {0}
jobs:
  unittests:
    strategy:
      matrix:
        python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10", "3.11" ]
    name: Python ${{matrix.python-version}} unittest
    runs-on: ubuntu-20.04
    steps:
      - name: "Checkout #1"
        uses: actions/checkout@v3.0.0
      - name: "Checkout #2 (for tools/read-version)"
        run: |
          git fetch --unshallow
          git remote add upstream https://git.launchpad.net/cloud-init
      - name: Install Python ${{matrix.python-version}}
        uses: actions/setup-python@v4
        with:
          python-version: ${{matrix.python-version}}
      - name: Install tox
        run: pip install tox
      - name: Run unittest
        env:
          TOXENV: py3
          PYTEST_ADDOPTS: -v
        run: tox