Skip to content

Commit 5ea81ee

Browse files
committed
updated action file
1 parent 614f8ab commit 5ea81ee

File tree

1 file changed

+43
-29
lines changed

1 file changed

+43
-29
lines changed

.github/workflows/action.yaml

Lines changed: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,46 @@
1-
name: Deploy my Lambda Function
2-
# trigger on all push events to main branch
3-
on:
4-
push:
5-
branches:
6-
- main
1+
name: Deploy Lambda Function
2+
on: [push]
73

84
jobs:
9-
build:
10-
runs-on: ubuntu-latest
11-
steps:
12-
- name: Check out code
13-
uses: actions/checkout@v2
14-
- name: Set up python
15-
uses: actions/setup-python@v2
16-
with:
17-
python-version: 3.8
18-
- name: Install libraries
19-
run: |
20-
cd function
21-
python -m pip install --upgrade pip
22-
if [ -f requirements.txt ]; then pip install -r requirements.txt -t .; fi
23-
- name: Create zip bundle
24-
run: |
25-
cd function
26-
zip -r ../${{ github.sha }}.zip .
27-
- name: Archive artifact
28-
uses: actions/upload-artifact@v2
29-
with:
30-
name: zipped-bundle
31-
path: ${{ github.sha}}.zip
325

6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Check out code
10+
uses: actions/checkout@v2
11+
- name: Set up Python
12+
uses: actions/setup-python@v2
13+
with:
14+
python-version: 3.8
15+
- name: Install libraries
16+
run: pip install flake8
17+
- name: Lint with flake8
18+
run: |
19+
cd function
20+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
21+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
22+
23+
build:
24+
runs-on: ubuntu-latest
25+
needs: lint
26+
steps:
27+
- name: Check out code
28+
uses: actions/checkout@v2
29+
- name: Set up Python
30+
uses: actions/setup-python@v2
31+
with:
32+
python-version: 3.8
33+
- name: Install libraries
34+
run: |
35+
cd function
36+
python -m pip install --upgrade pip
37+
if [ -f requirements.txt ]; then pip install -r requirements.txt -t .; fi
38+
- name: Zip bundle
39+
run: |
40+
cd function
41+
zip -r ../${{ github.sha }}.zip .
42+
- name: Archive artifact
43+
uses: actions/upload-artifact@v2
44+
with:
45+
name: zipped-bundle
46+
path: ${{ github.sha }}.zip

0 commit comments

Comments
 (0)