-
Notifications
You must be signed in to change notification settings - Fork 10
69 lines (63 loc) · 2.17 KB
/
python-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
name: Explorer Tests
on:
push:
branches: [main]
pull_request:
jobs:
mappings_explorer_tests:
runs-on: ubuntu-latest
steps:
# Configure Environment
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: 3.9
# Prepare Poetry
- name: Attempt Poetry install from cache
uses: actions/cache@v3
id: cached-poetry
with:
path: ./.poetry
key: venv::${{ runner.os }}::${{ steps.setup-python.outputs.python-version }}::poetry
- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
run: |
python -m venv .poetry
source ./.poetry/bin/activate
pip install poetry
deactivate
mkdir $PWD/.poetry/.bin
ln -s $PWD/.poetry/bin/poetry $PWD/.poetry/.bin/poetry
- name: Add Poetry to PATH
run: echo "$PWD/.poetry/.bin" >> $GITHUB_PATH
# Prepare Virtual Environment
- name: Configure Poetry
run: poetry config virtualenvs.in-project true
- name: Load cached virtual environment
uses: actions/cache@v3
id: cached-dependencies
with:
path: ./.venv
key: venv::${{ runner.os }}::${{ steps.setup-python.outputs.python-version }}::${{ hashFiles('./poetry.lock') }}
- name: Install dependencies
if: steps.cached-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install Mappings Explorer
run: poetry install --no-interaction --only-root
# Check Lint, Test, Validate mappings
- name: Lint Mappings Explorer
run: poetry run make lint
- name: Test Mappings Explorer
run: poetry run make test-ci
- name: Validate Mappings Files
run: poetry run mapex validate ${GITHUB_WORKSPACE}/mappings
# Upload Test Coverage
- name: Upload coverage to CodeCov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_SECRET }}
files: ./coverage.xml
verbose: true