-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (55 loc) · 1.78 KB
/
test-format-lint.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
61
62
63
64
65
name: Test, format and lint
on:
workflow_dispatch:
pull_request:
branches:
- main
jobs:
test-format-lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- lambda: blazer
ruby: 3.0.4
- lambda: google-cidr
python: 3.9
steps:
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # tag=v2.11.1
id: changes
with:
filters: |
lambda:
- '${{ matrix.lambda }}/**'
- '.github/workflows/test-format-lint.yml'
- name: Setup Python
if: steps.changes.outputs.lambda == 'true' && matrix.python
uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0
with:
python-version: ${{ matrix.python }}
cache: pip
- name: Setup Ruby
if: steps.changes.outputs.lambda == 'true' && matrix.ruby
uses: ruby/setup-ruby@ee26e27437bde475b19a6bf8cb73c9fa658876a2 # v1.134.0
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Install deps
if: steps.changes.outputs.lambda == 'true'
working-directory: ${{ matrix.lambda }}
run: make install
- name: Lint
if: steps.changes.outputs.lambda == 'true'
working-directory: ${{ matrix.lambda }}
run: make lint
- name: Format
if: steps.changes.outputs.lambda == 'true'
working-directory: ${{ matrix.lambda }}
run: make ARGS=--check fmt
- name: Test
if: steps.changes.outputs.lambda == 'true'
working-directory: ${{ matrix.lambda }}
run: make test