forked from zjesko/mlops-iris
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (39 loc) · 1.24 KB
/
cicd.yml
File metadata and controls
44 lines (39 loc) · 1.24 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
name: ci-cd
# run the action on pull_requests and pushes
on: [pull_request, push]
jobs:
# first job to test the application using pytest
build:
runs-on: ubuntu-latest # choose the OS for running the action
# define the individual sequential steps to be run
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Run pytest
run: |
pytest
# second job to zip the codebase and upload it as an artifact when build succeeds
upload_zip:
runs-on: ubuntu-latest # choose the OS for running the action
needs: build
# only run this action for pushes
if: ${{ github.event_name == 'push' }}
# define the individual sequential steps to be run
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Zip the code
run: |
zip -r release.zip . -x ".git/*" ".github/*" ".gitignore"
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: code-release
path: release.zip