This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 183
107 lines (91 loc) · 3.04 KB
/
chef_deployment_test.yml
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: chef_deployment_test
# Only run tests for main branch or if the PR has relevant changes
on:
push:
branches:
- main
pull_request:
paths:
- '.github/workflows/chef_deployment_test.yml'
- 'deployments/chef/**'
- 'tests/deployments/chef/**'
- 'tests/packaging/common.py'
- '.github/scripts/run-pytest.sh'
concurrency:
group: chef_deployment_test-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
RESULT_PATH: testresults
PYTHON_VERSION: 3.8.10
REQUIREMENTS_PATH: "tests/requirements.txt"
jobs:
chef_deployment_test:
name: chef_deployment_test
runs-on: ubuntu-20.04
strategy:
matrix:
SYS_PACKAGE: [ "deb", "rpm" ]
steps:
- name: Check out the codebase.
uses: actions/checkout@v3
- name: Test chef deployment
env:
SYS_PACKAGE: ${{ matrix.SYS_PACKAGE }}
DEPLOYMENT_TYPE: chef
run: .github/scripts/run-deployment-tests.sh
- name: Uploading test result artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.SYS_PACKAGE }}-chef-deployment-test-result
path: ~/${{ env.RESULT_PATH }}
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Caching dependency
uses: actions/cache@v3
with:
path: |
~/.cache/pip
key: v1-pytest-${{ env.PYTHON_VERSION }}-${{ hashFiles(env.REQUIREMENTS_PATH) }}
- name: Install pytest
run: pip install -r "${{ env.REQUIREMENTS_PATH }}"
- name: Run pytest
env:
WORKERS: 2
PYTEST_OPTIONS: ""
TESTS_DIR: ./tests/deployments
run: .github/scripts/run-pytest.sh
- name: Uploading pytest result artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.SYS_PACKAGE }}-chef-pytest-result
path: |
~/${{ env.RESULT_PATH }}/results.html
~/${{ env.RESULT_PATH }}/results.xml
win_chef_deployment_test:
name: win_chef_deployment_test
runs-on: ${{ matrix.OS }}
strategy:
matrix:
OS: ["windows-2019", "windows-2022"]
env:
SANIC_NO_UVLOOP: 'true'
steps:
- name: Check out the codebase.
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
cache-dependency-path: ${{ env.REQUIREMENTS_PATH }}
- name: Install pytest
run: pip install -r "${{ env.REQUIREMENTS_PATH }}"
- name: Run tests
run: pytest -m "windows_only" --verbose --junitxml=${{ env.RESULT_PATH }}/test_results.xml --html=${{ env.RESULT_PATH }}/test_results.html --self-contained-html tests/deployments/chef/
- name: Uploading pytest result artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-chef-pytest-result
path: ${{ env.RESULT_PATH }}