forked from beneisner/python_pkg_template
-
Notifications
You must be signed in to change notification settings - Fork 5
45 lines (36 loc) · 1.15 KB
/
run-tests.yaml
File metadata and controls
45 lines (36 loc) · 1.15 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
name: Run Tests
on:
workflow_call:
inputs:
install_string:
required: True
type: string
image_tag:
required: True
type: string
default: "latest"
jobs:
test:
runs-on: ubuntu-latest
container:
# Image tag is "latest" if the branch is main, else it is the branch name.
image: beisner/python_ml_project_template:${{ inputs.image_tag }}
defaults:
run:
working-directory: /opt/rpad/code
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
# Link the code from the default checkout directory to the correct directory.
# Use the github workspace variable to get the correct directory.
# Can't use the checkout action to checkout to a different directory, so we have to simlink.
- name: Move code to correct directory
run: rm -rf /opt/rpad/code && ln -s $GITHUB_WORKSPACE /opt/rpad/code
- name: Code Quality
run: python -m black src/ tests/ --check
- name: MyPy Typechecking
run: python -m mypy src/ tests/
# Run tests.
- name: Test with pytest
run: python -m pytest