-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (59 loc) · 1.85 KB
/
ci_dev.yaml
File metadata and controls
76 lines (59 loc) · 1.85 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
67
68
69
70
71
72
73
74
75
76
name: CI Dev
on:
push:
paths: ['dev/**']
pull_request:
paths: ['dev/**']
jobs:
#------#
# Lint #
#------#
lint:
runs-on: ubuntu-latest
strategy:
matrix:
application: ["webapp", "api"]
steps:
- uses: actions/checkout@v3
name: Checkout source code
- uses: actions/setup-python@v2
name: Setting up Python 3.9
with:
python-version: 3.9
- name: Install dependencies
working-directory: dev/${{ matrix.application }}/src
run: |
python -m pip install --upgrade pip
pip install flake8
pip install -r requirements.txt
- name: Lint the code with flake8
working-directory: dev/${{ matrix.application }}/src
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
#--------------#
# Docker Build #
#--------------#
docker-build:
runs-on: ubuntu-latest
strategy:
matrix:
application: ["webapp", "api"]
steps:
- uses: actions/checkout@v3
name: Checkout source code
- uses: docker/setup-qemu-action@v2
name: Set up QEMU
- uses: docker/setup-buildx-action@v2
name: Set up Docker Buildx
- name: Get tag
id: vars
run: echo "tag=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- uses: docker/build-push-action@v4
name: Build
with:
context: dev/${{ matrix.application }}
push: false
tags: ${{ matrix.application }}:${{ steps.vars.outputs.tag }}