-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (43 loc) · 1.33 KB
/
CI_PIPELINE.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
name: CI Pipeline
on:
pull_request:
types: [ opened, reopened, synchronize ]
branches:
- develop
- main
jobs:
build:
name: Lint, Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
project: [ frontend, backend ]
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Check for changes in ${{ matrix.project }}
id: changes
run: |
if git diff --name-only origin/${{ github.event.pull_request.base.ref }}...HEAD | grep -q "^${{ matrix.project }}/"; then
echo "changed=true" >> $GITHUB_ENV
else
echo "changed=false" >> $GITHUB_ENV
fi
- name: Install Dependencies for ${{ matrix.project }}
if: env.changed == 'true'
run: yarn install
working-directory: ${{ matrix.project }}
- name: Lint ${{ matrix.project }}
if: env.changed == 'true'
run: yarn format-check
working-directory: ${{ matrix.project }}
- name: Build ${{ matrix.project }}
if: env.changed == 'true'
run: yarn build
working-directory: ${{ matrix.project }}
- name: Test ${{ matrix.project }}
if: env.changed == 'true'
run: yarn test
working-directory: ${{ matrix.project }}