-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (49 loc) · 1.13 KB
/
test.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: Test
on:
pull_request:
branches:
- main
paths:
- "threatx_api_client/**"
- "tests/**"
push:
branches:
- main
paths:
- "threatx_api_client/**"
- "tests/**"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: write
id-token: write
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Repo checkout
uses: actions/checkout@v4
- name: Prepare environment
uses: "./.github/actions/environment"
- name: Ruff check
run: poetry run ruff check
- name: Pytest
run: poetry run pytest
env:
TX_API_PROD_KEY: ${{ secrets.TX_API_PROD_KEY }}
TX_API_POD_KEY: ${{ secrets.TX_API_POD_KEY }}
results:
name: Test results
needs: test
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- run: |
result="${{ needs.test.result }}"
if [[ $result == "success" || $result == "skipped" ]]; then
exit 0
else
exit 1
fi