Repository navigation
75 lines (63 loc) · 1.97 KB
/
Copy pathpython-package.yml
File metadata and controls
75 lines (63 loc) · 1.97 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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: PyIconeus
on:
push:
branches: [ "master", "dev" ]
pull_request:
branches: [ "master", "dev" ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
prepare-data:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
pip install tqdm
- name: Restore test data cache
id: test-data-cache
uses: actions/cache@v6
with:
path: tests/data/
key: pyiconeus-test-data-${{ runner.os }}-${{ hashFiles('download_script.py') }}
- name: Download test data
if: steps.test-data-cache.outputs.cache-hit != 'true'
run: python download_script.py
build:
needs: prepare-data
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- name: Restore test data cache
uses: actions/cache/restore@v6
with:
path: tests/data/
key: pyiconeus-test-data-${{ runner.os }}-${{ hashFiles('download_script.py') }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install Hatch
run: pipx install hatch
- name: Run test with coverage
run: hatch test -c