-
Notifications
You must be signed in to change notification settings - Fork 18
82 lines (69 loc) · 1.95 KB
/
ci-cd-workflow.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
name: Climate assessment CI-CD
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
linting:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install poetry
shell: bash
run: |
pipx install poetry
which poetry
poetry --version # Check poetry installation
- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: poetry
- name: Set up Poetry environment
shell: bash
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Install dev dependencies
shell: bash
run: |
poetry install --no-interaction --no-root --all-extras --only 'main,dev'
- name: Formatting and linters
run: |
poetry run pre-commit run --all-files
build:
runs-on: ubuntu-latest
strategy:
matrix:
python_version: ["3.11", "3.12"]
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install poetry
shell: bash
run: |
pipx install poetry
which poetry
poetry --version # Check poetry installation
- name: Set up Python ${{ matrix.python_version }}
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
cache: poetry
- name: Set up Poetry environment
shell: bash
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Install test dependencies and package
shell: bash
run: |
poetry install --no-interaction --all-extras --only 'main,tests,dev'
- name: Test with pytest
run: |
poetry run pytest tests -m "not nightly and not wg3" -r a -vv --cov=climate_assessment --cov-report=xml