This repository has been archived by the owner on Dec 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (54 loc) · 1.54 KB
/
pytest.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
name: run_tests
on:
workflow_call:
inputs:
workflow-call-ckeck:
description: 'set to true if calling from a workflow. So we can check the trigger and set the secrets accordingly'
required: true
type: boolean
secrets:
MAuserPAT-workflow-call:
required: true
MAuserName-workflow-call:
required: true
push:
# This way it only triggers on branch pushes,
# and ignores releases that push a tag.
branches:
- '**'
jobs:
test-job:
strategy:
fail-fast: false
matrix:
python-version: [3.8]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.8.0
- name: Poetry install
run: poetry install
- if: ${{ inputs.workflow-call-ckeck }}
env:
# Machine user private access token
MAuserPAT: ${{ secrets.MAuserPAT-workflow-call }}
# Machine user name
MAuserName: ${{ secrets.MAuserName-workflow-call }}
run:
poetry run nox -s tests
- if: ${{ inputs.workflow-call-ckeck == false }}
env:
# Machine user private access token
MAuserPAT: ${{ secrets.EXA_CI_TOKEN_FOR_ADDING_AUTOMATIC_DOCUMENTATION }}
# Machine user name
MAuserName: ${{ secrets.EXA_CI_USER_NAME }}
run:
poetry run nox -s tests