-
Notifications
You must be signed in to change notification settings - Fork 37
62 lines (54 loc) · 1.85 KB
/
buildPullRequest.yml
File metadata and controls
62 lines (54 loc) · 1.85 KB
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
name: CI-PR
on:
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
setup-matrix:
runs-on: ubuntu-latest
steps:
- name: Checkout playbooks
uses: actions/checkout@v2
with:
repository: devonfw-tutorials/tutorials
path: playbooks
- id: changedfiles
uses: jitterbit/get-changed-files@v1
- name: Setup matrix combinations
id: setup-matrix-combinations
run: |
dirs=()
for changed_file in ${{ steps.changedfiles.outputs.all }}; do
dir="$(echo $changed_file | cut -d/ -f1)"
if [[ ! " ${dirs[@]} " =~ " ${dir} " ]]; then
MATRIX_PARAMS_COMBINATIONS=$MATRIX_PARAMS_COMBINATIONS'{"tutorial": "'$dir'"},'
fi
dirs+=($dir)
done
echo ::set-output name=matrix-combinations::{\"include\":[$MATRIX_PARAMS_COMBINATIONS]}
outputs:
matrix-combinations: ${{ steps.setup-matrix-combinations.outputs.matrix-combinations }}
build_pullRequest:
runs-on: ubuntu-latest
needs: setup-matrix
strategy:
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix-combinations) }}
steps:
- name: Checkout tutorial-compiler
uses: actions/checkout@v2
with:
repository: devonfw-tutorials/tutorial-compiler
- name: Checkout playbooks
uses: actions/checkout@v2
with:
repository: devonfw-tutorials/tutorials
path: playbooks
- uses: actions/setup-node@v2-beta
with:
node-version: '12'
- name: install TS
run: npm install typescript
- name: npm install
run: npm install
- name: run buildRun.sh
run: sh buildRun.sh --user ${{ github.actor }} --branch ${{ github.event.pull_request.head.ref }} -p ${{ matrix.tutorial }}