generated from konveyor-ecosystem/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 39
56 lines (49 loc) · 1.97 KB
/
test-code-on-pr.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
name: Test Code on PR
on: [pull_request]
jobs:
test-code-on-pr:
name: Test Code on PR Runner
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
# TODO: After merging #255, we should probably change it so we use
# `requirements.in` over `requirements.txt`.
python-version: ["3.12"]
# Github actions only supports x64 architecture for now, arm64 is in a
# private beta.
architecture: ["x64"]
# Exclude no combinations for now
# exclude: []
steps:
- uses: actions/checkout@v4
- name: Set up PytStrEnumhon ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
cache: pip
# After merging #225, use this as the cache instead.The cahce merely
# uses a hash of a specififed file to determine if it needs to update
# cache-dependency-path: requirements.in
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel coverage
pip install -r requirements.txt
- name: Download prerequisites
run: |
cd example
./fetch.sh
cd ..
- name: Test with unittest
run: |
python -m coverage run --branch -m unittest discover
- name: Generate coverage report
run: |
python -m coverage html --skip-empty -d coverage-report-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.architecture }}
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.architecture }}
path: coverage-report-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.architecture }}
if: ${{ always()}}