-
-
Notifications
You must be signed in to change notification settings - Fork 12
76 lines (68 loc) · 1.7 KB
/
lint-and-unit-tests.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: lint-and-unit-tests
on:
pull_request:
push:
branches:
- main
- master
schedule:
- cron: 0 1 * * *
workflow_dispatch:
jobs:
build-and-test-python:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Clone StackStorm/st2 repo
run: |
make .clone_st2_repo
- name: Download and install depedencies
run: |
sudo apt-get update
sudo apt-get -y install libldap2-dev libsasl2-dev
sudo apt-get -y install python3-virtualenv
make requirements
- name: Run lint and tests (Python ${{ matrix.python-version }})
run: |
make .lint
make .unit-tests
set_merge_ok:
name: Set Merge OK
if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
needs:
- build-and-test-python
outputs:
merge_ok: ${{ steps.set_merge_ok.outputs.merge_ok }}
runs-on: ubuntu-latest
steps:
- id: set_merge_ok
run: echo 'merge_ok=true' >> ${GITHUB_OUTPUT}
merge_ok:
name: Merge OK
if: always()
needs:
- set_merge_ok
runs-on: ubuntu-latest
steps:
- run: |
merge_ok="${{ needs.set_merge_ok.outputs.merge_ok }}"
if [[ "${merge_ok}" == "true" ]]; then
echo "Merge OK"
exit 0
else
echo "Merge NOT OK"
exit 1
fi