-
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@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.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@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: ${{ matrix.python }}
cache: pip
- name: Setup Ruby
if: steps.changes.outputs.lambda == 'true' && matrix.ruby
uses: ruby/setup-ruby@54a18e26dbbb1eabc604f317ade9a5788dddef81 # v1.159.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