-
Notifications
You must be signed in to change notification settings - Fork 12
82 lines (75 loc) · 2.06 KB
/
check.yaml
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Check workflow running linter, unit and functional tests
concurrency:
group: ${{ github.workflow }}
on:
workflow_call:
pull_request:
types: [ opened, synchronize, reopened ]
branches: [ master, main ]
paths-ignore:
- '**.md'
- '**.rst'
jobs:
lint-unit:
name: Lint checkers and unit tests
uses: canonical/bootstack-actions/.github/workflows/lint-unit.yaml@v2
strategy:
fail-fast: false
matrix:
python-version: ['3.10']
with:
python-version: ${{ matrix.python-version }}
tox-version: '<4'
snap-build:
name: Build snap package
needs: lint-unit
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install tox
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Setup LXD
uses: canonical/[email protected]
with:
channel: latest/stable
- name: Install snapcraft
run: sudo snap install snapcraft --classic
- name: Build snap
run: make build
- name: Upload the built snap as an artifact
uses: actions/upload-artifact@v3
with:
name: SNAP_FILE
path: charmed-openstack-upgrader.snap
func:
name: Functional tests
needs: snap-build
runs-on: self-hosted
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install tox
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Download snap file artifact
uses: actions/download-artifact@v3
with:
name: SNAP_FILE
- name: Run func tests
run: TEST_SNAP=$GITHUB_WORKSPACE/charmed-openstack-upgrader.snap tox -e func