-
Notifications
You must be signed in to change notification settings - Fork 20
158 lines (136 loc) · 5.63 KB
/
gradle_mc.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# (c) https://github.com/MontiCore/monticore
name: Gradle Test & Build
concurrency: # run this test workflow only once per "branch"
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push: # run this test pipeline on every push
paths-ignore:
- "*.md"
pull_request: # and pull request (Note: We can skip pull request events IFF the PR is not done from a fork)
paths-ignore:
- "*.md"
repository_dispatch: # and on request of upstream projects
types: [ trigger_after_upstream_deploy ]
env:
GRADLE_VERSION: 7.4 # Gradle version used
GRADLE_CLI_OPTS: "-Pci --build-cache " # CLI option passed to Gradle
GRADLE_BUILD_ACTION_CACHE_KEY_JOB: "test-cache-${{ github.head_ref }}.${{ github.sha }}"
permissions:
contents: read # This action may run somewhat unsafe code
jobs:
build-generator: # Note: Build-Cache may not work yet
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name # do not run duplicate jobs on PRs
runs-on: ubuntu-latest
steps:
- name: Checkout project sources
uses: actions/checkout@v3
- name: Build the monticore-generator
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: ${{env.GRADLE_VERSION}}
arguments: build -p monticore-generator ${{env.GRADLE_CLI_OPTS}}
build-mc:
runs-on: ubuntu-latest
needs: build-generator
steps:
- name: Checkout project sources
uses: actions/checkout@v3
- name: Build monticore (buildMC)
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: ${{env.GRADLE_VERSION}}
arguments: buildMC ${{env.GRADLE_CLI_OPTS}} -PgenTR=true -PgenEMF=true -PgenTagging=true
# first set of experiments from the handbook
test-01-experiments:
runs-on: ubuntu-latest
needs: build-mc
steps:
- name: Checkout project sources
uses: actions/checkout@v3
- name: Test 01.experiments
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: ${{env.GRADLE_VERSION}}
arguments: build test -p monticore-test/01.experiments ${{env.GRADLE_CLI_OPTS}} -PgenEMF=true
# second set of experiments from the handbook
test-02-experiments:
runs-on: ubuntu-latest
needs: build-mc
steps:
- name: Checkout project sources
uses: actions/checkout@v3
- name: Test 02.experiments
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: ${{env.GRADLE_VERSION}}
arguments: build test -p monticore-test/02.experiments ${{env.GRADLE_CLI_OPTS}} -PgenEMF=true
# test integration tests from the it project
test-it:
runs-on: ubuntu-latest
needs: build-mc
steps:
- name: Checkout project sources
uses: actions/checkout@v3
- name: Test monticore-test/it
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: ${{env.GRADLE_VERSION}}
arguments: build test -p monticore-test/it ${{env.GRADLE_CLI_OPTS}}
- name: Checking that all file handles in the target folder are closed
run: if pgrep java | xargs -i ls -la /proc/{}/fd | grep "monticore-test/it/target/"; then echo "Found open file handles!"; exit 1; else echo "No open file handles."; exit 0; fi
# test integration tests from the it project, using the emf profile
test-it-emf:
runs-on: ubuntu-latest
needs: build-mc
steps:
- name: Checkout project sources
uses: actions/checkout@v3
- name: Test monticore-test/it with emf profile
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: ${{env.GRADLE_VERSION}}
arguments: build test -p monticore-test/it ${{env.GRADLE_CLI_OPTS}} -PbuildProfile=emf -PgenEMF=true
# Grammar integration tests
test-grammar-it:
runs-on: ubuntu-latest
needs: build-mc
steps:
- name: Checkout project sources
uses: actions/checkout@v3
- name: Test monticore-grammar-it
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: ${{env.GRADLE_VERSION}}
arguments: build test -p monticore-test/monticore-grammar-it ${{env.GRADLE_CLI_OPTS}} -PgenEMF=true
# Transformation tests
test-montitrans:
runs-on: ubuntu-latest
needs: build-mc
steps:
- name: Checkout project sources
uses: actions/checkout@v3
- name: Test monticore-grammar-it
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: ${{env.GRADLE_VERSION}}
arguments: build test -p monticore-test/montitrans ${{env.GRADLE_CLI_OPTS}} -PgenTR=true
# Run the MontiVerse pipeline (tests this change on a suite of projects)
trigger-montiverse:
if: github.event_name == 'pull_request' # only run on PRs
runs-on: ubuntu-latest
steps:
- name: Trigger MontiVerse
uses: digital-blueprint/gitlab-pipeline-trigger-action@v1
with:
host: 'git.rwth-aachen.de'
trigger_token: ${{ secrets.MONTIVERSE_TRIGGER_TOKEN }}
access_token: ${{ secrets.MONTIVERSE_ACCESS_TOKEN }} # Access is required to show the status
id: '91803' # montiverseci project id
ref: 'main'
# TODO: Include entire git path here instead (due to PRs)
variables: '{"MONTICORE_BRANCH":"${{github.event.pull_request.head.ref }}", "MONTICORE_PROJECT":"${{ github.event.pull_request.head.repo.full_name }}"}'
# TODO: Proper message in PRs (turn the MontiVerse into a GitHub Action?)?
# TODO: FIX to specific version instead of @v3
# TODO: check-links
# TODO: checkMLCs