-
Notifications
You must be signed in to change notification settings - Fork 4
61 lines (59 loc) · 2.12 KB
/
pytest.yaml
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
name: LocalTests
on:
pull_request_target:
types: [assigned, opened, synchronize, reopened, ready_for_review]
push:
branches:
- main
- future
# Jobs section
jobs:
LocalTests:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
runs-on: ${{ matrix.os }}
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Running Local Tests
run: |
## Install pytest
pip install pytest
pytest
# TODO: Ideally make a PR comment too but there is no need to for now
# # fetch the execution results of the passed/failed
# cd workflow && bash parse.sh > results.log 2>&1
# # get the timer
# timer=$(LANG=en_us_88591; date)
# echo "VERSION<<EOF" >> $GITHUB_ENV
# echo "OS:${{matrix.os}}" >> $GITHUB_ENV
# echo "$timer" >> $GITHUB_ENV
# # Parse the results and construct a github message post
# # we append the data to the global env
# cat results.log >> $GITHUB_ENV
# echo 'EOF' >> $GITHUB_ENV
# - name: Comment on PR
# uses: actions/github-script@v3
# with:
# script: |
# let body = `${{ env.VERSION }}`
# console.log(context)
# // if we are directly pushing on main/future, we cannot push comments -> exit
# if (context.eventName === "push" && (context.ref === "refs/heads/main" || context.ref === "refs/heads/future")) {
# return 0;
# }
# github.issues.createComment({
# issue_number: context.issue.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# body: body,
# })
# - name: Exit Code
# run: |
# # check if everything executed without errors
# cd ../pash/scripts/workflow && bash exit_code.sh