-
Notifications
You must be signed in to change notification settings - Fork 224
58 lines (55 loc) · 1.69 KB
/
konfig-api-portal-tests.yaml
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
name: konfig-api-portaltests
on:
push:
branches:
- main
pull_request:
jobs:
check_for_relevant_changes:
runs-on: ubuntu-latest
outputs:
shouldRun: ${{ steps.check_changes.outputs.shouldRun }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get changed files
id: get_changed_files
uses: Ana06/[email protected]
- name: Check for changes in specific paths
id: check_changes
run: |
for file in ${{ steps.get_changed_files.outputs.all }}; do
if [[ $file =~ ^generator/konfig-(next-app|dash)/ && ! $file =~ \.md$ ]]; then
echo "shouldRun=true" >> "$GITHUB_OUTPUT"
exit 0
fi
done
unit-tests:
needs: check_for_relevant_changes
if: needs.check_for_relevant_changes.outputs.shouldRun == 'true'
strategy:
matrix:
os: ['ubuntu-latest']
# major version 18
node_version: ['lts/hydrogen']
fail-fast: false
runs-on: ${{ matrix.os }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.SUBMODULES_ACCESS_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
cache: yarn
cache-dependency-path: generator/konfig-dash/yarn.lock
- run: yarn install --network-timeout 600000
working-directory: generator/konfig-dash
- run: yarn build
working-directory: generator/konfig-dash
- run: yarn
working-directory: generator/konfig-next-app
- run: yarn test
working-directory: generator/konfig-next-app