-
Notifications
You must be signed in to change notification settings - Fork 58
60 lines (51 loc) · 2.1 KB
/
integration.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
name: Integration Testing
on:
workflow_dispatch:
schedule:
- cron: '0 0 */3 * *'
jobs:
install_with_run_sh:
runs-on: ubuntu-latest
steps:
- name: Install Docker
run: |
printf '%s\n' "deb https://download.docker.com/linux/debian bullseye stable" | sudo tee /etc/apt/sources.list.d/docker-ce.list
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/docker-ce-archive-keyring.gpg
sudo apt update -y
sudo apt install docker-ce docker-ce-cli containerd.io -y
sudo systemctl enable docker --now
- name: Check Docker
run: |
if ! sudo docker info > /dev/null 2>&1; then
echo "Docker is not running"
exit 1
fi
- uses: actions/checkout@v3
- name: Deploy Lab
id: deploy
run: |
sudo DEBUG=true make deploy
working-directory: ./lab
- name: Test Lab
id: test
run: |
sleep 45 && sudo make test
working-directory: ./lab
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Run Python Unit Tests
run: |
pip3 install pytest requests
python3 -m pytest ./lab/tests/*
- name: Slack Notification Success
id: notify_success
#if: steps.deploy.outcome == 'success' && steps.test.outcome == 'success'
#run: |
# curl -X POST -H 'Content-type: application/json' --data '{"text":"[SUCCESS] Integration test (https://github.com/dolevf/Black-Hat-Bash/actions/runs/${{github.run_id}})"}' ${{ secrets.SLACK_WEBHOOK }}
- name: Slack Notification Failure
id: notify_failure
if: steps.deploy.outcome != 'success' || steps.test.outcome != 'success'
run: |
curl -X POST -H 'Content-type: application/json' --data '{"text":"[FAILURE] Integration test (https://github.com/dolevf/Black-Hat-Bash/actions/runs/${{github.run_id}}) <!here>" }' ${{secrets.SLACK_WEBHOOK}}