forked from austinLorenzMccoy/networkSecurity_project
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (63 loc) · 1.81 KB
/
ci-cd.yml
File metadata and controls
66 lines (63 loc) · 1.81 KB
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
name: Network Security CI/CD
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
- name: Run tests
run: |
pytest --cov=networksecurity
- name: Upload coverage report
uses: codecov/codecov-action@v1
dvc-tracking:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
- name: Setup DVC
uses: iterative/setup-dvc@v1
- name: Configure DAGsHub credentials
run: |
echo "machine dagshub.com login austinLorenzMccoy password ${{ secrets.DAGSHUB_TOKEN }}" > $HOME/.netrc
chmod 600 $HOME/.netrc
- name: Pull DVC data
run: |
dvc remote add origin https://dagshub.com/austinLorenzMccoy/networkSecurity_project.dvc
dvc pull
- name: Run DVC pipeline
run: dvc repro
- name: Push DVC results
run: dvc push
- name: Log metrics to DAGsHub
run: |
pip install dagshub
python -c "from dagshub import dagshub_logger; dagshub_logger(metrics_path='reports/direct_training_metrics.json')"
env:
DAGSHUB_USER: austinLorenzMccoy
DAGSHUB_REPO: networkSecurity_project