-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (74 loc) · 2.3 KB
/
Copy pathtest.yml
File metadata and controls
89 lines (74 loc) · 2.3 KB
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
name: CICD - Test Code
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
unit:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Configure credentials
uses: tracebit-com/tracebit-community-action@d0a68cb29196eafce908de76ec596a7e9ca049da
with:
api-token: ${{ secrets.SECURITY_API_TOKEN }}
profile: admin
profile-region: us-east-1
async: true
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12'
- name: Install Python dependencies
run: |
pip install poetry==2.0.1
- name: Run Unit Tests
run: |
poetry install
poetry run pytest
- name: Verify package install and CLI entry point
run: |
poetry build
python -m venv /tmp/test-install
/tmp/test-install/bin/pip install dist/ossprey-*.whl
/tmp/test-install/bin/ossprey --help
rm -rf /tmp/test-install
- name: Run Runtime Tests
run: |
poetry run python -m ossprey --dry-run-safe --package test/test_packages/npm_simple_math/ --mode npm
poetry run python -m ossprey --dry-run-safe --package test/test_packages/yarn_simple_math/ --mode yarn
poetry run python -m ossprey --dry-run-safe --package test/test_packages/python_simple_math/ --mode python-requirements
smoke:
name: Smoke Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12'
- name: Install Python dependencies
run: |
pip install poetry==2.0.1
poetry install
- name: Run smoke tests
run: |
poetry run pytest test/smoke -m smoke -v
test:
name: test
runs-on: ubuntu-latest
needs: [unit, smoke]
if: always()
steps:
- name: Aggregate result
run: |
if [ "${{ needs.unit.result }}" != "success" ] || [ "${{ needs.smoke.result }}" != "success" ]; then
echo "unit=${{ needs.unit.result }} smoke=${{ needs.smoke.result }}"
exit 1
fi