-
Notifications
You must be signed in to change notification settings - Fork 188
63 lines (61 loc) · 1.88 KB
/
check-showcases.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
name: Check Showcases
on:
schedule:
- cron: "0 0,12 * * *" # run twice daily
push:
branches:
- master
paths:
- "showcases/**"
pull_request:
branches:
- "**"
paths:
- "showcases/**"
workflow_dispatch: {}
jobs:
check-index-showcases:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3.5.2
- name: Setup Node
uses: actions/setup-node@v3.6.0
with:
node-version: 16
- name: Prepare static artifacts
run: |
npm install
npm run check:showcases-index
test-showcases:
# except for pull request, make sure to run the pipeline only for default branch
if: github.event_name == 'pull_request' || (github.ref == 'refs/heads/master' && github.repository == 'finos/legend')
name: Run Compilation Check for Showcases
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "temurin"
cache: "maven"
# For PRs only want to run changed files
- name: Get Changed Files for PR
if: ${{ github.event_name == 'pull_request' }}
working-directory: ./showcases
run: echo "CHANGED_FILES=`git diff --name-only --diff-filter=AMR $GITHUB_BASE_REF...$GITHUB_HEAD_REF | paste -sd ','`" >> "$GITHUB_ENV"
- name: Run test
working-directory: ./showcases
run: |
if [ $SHOWCASE_LOCATIONS == "" ]; then
locations=data
else
locations=$SHOWCASE_LOCATIONS
fi
mvn versions:use-latest-versions
mvn -B -Dmaven.surefire.thread.count=$THREAD_COUNT -Dshowcase.locations=$locations test
env:
THREAD_COUNT: 3
SHOWCASE_LOCATIONS: ${{ env.CHANGED_FILES }}