forked from MLH-Fellowship/project-pog-squad
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (40 loc) · 1.19 KB
/
run_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
name: Run Tests # Workflow name
on:
push: # Workflow is triggered for all pushes to main branch
branches:
- main
pull_request: # Workflow is triggered for all pull requests to main branch
branches:
- main
jobs:
test: # Job created on Ubuntu VM
runs-on: ubuntu-latest
name: Run Tests
env:
TESTING: true
steps: # Steps for job
- name: Checkout Repository
uses: actions/checkout@v2
id: 's1'
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11.1'
id: 's2'
- name: Setup Python Virtual Environment
run: python -m venv env
id: 's3'
- name: Install Dependencies
run: env/bin/pip install -r requirements.txt
id: 's4'
- name: Run Tests
run: ./run_test.sh
id: 's5'
- name: Post to Discord (Success)
id: 's6_1'
if: steps.s5.outcome == 'success'
run: curl -s -X POST "${{ secrets.DISCORD_WEBHOOK }}" -d "content=Tests passed! :white_check_mark:"
- name: Post to Discord (Failure)
id: 's6_2'
if: steps.s5.outcome == 'failure'
run: curl -s -X POST "${{ secrets.DISCORD_WEBHOOK }}" -d "content=Tests failed! :warning:"