-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (45 loc) · 1.19 KB
/
pytest-datamodules.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
name: pytest-datamodules
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
changedfiles:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Changed Datamodules
uses: actions/cache@v3
id: changed-datamodules
with:
path: tests/datamodules
key: hashFiles('torchfl/datamodules/*')
outputs:
datamodules-cache-hit: ${{ steps.changed-datamodules.outputs.cache-hit }}
test-datamodules:
name: "Test changed datamodules."
runs-on: ubuntu-latest
needs: changedfiles
strategy:
matrix:
python-version: ["3.10"]
if: ${{needs.changedfiles.outputs.datamodules-cache-hit != 'true'}}
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install dependencies
run: |
poetry install
- name: PyTest for datamodules
run: |
poetry run pytest tests/datamodules/