Skip to content

Commit 5f04aa9

Browse files
ci: test each MPS version separately to conserve disk space
1 parent 6a9f4e2 commit 5f04aa9

File tree

2 files changed

+37
-10
lines changed

2 files changed

+37
-10
lines changed

.github/workflows/build.yml

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,51 @@
1-
# This workflow will build a Java project with Gradle
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3-
4-
name: Java CI with Gradle
1+
name: Build
52

63
on:
74
push:
8-
branches: [ "main" ]
5+
branches: main
96
pull_request:
10-
branches: [ "main" ]
117

128
jobs:
13-
build:
9+
assemble:
1410
runs-on: ubuntu-latest
11+
outputs:
12+
mps_versions: ${{ steps.mps_versions.outputs.mps_versions }}
1513
steps:
1614
- uses: actions/checkout@v4
1715
- name: Set up JDK
1816
uses: actions/setup-java@v4
1917
with:
2018
distribution: 'temurin'
2119
java-version: '21'
22-
- name: Setup Gradle
20+
- name: Set up Gradle
2321
uses: gradle/actions/setup-gradle@v4
24-
- name: Build with Gradle
25-
run: ./gradlew build
22+
- name: Assemble
23+
run: ./gradlew --no-daemon --no-parallel assemble
24+
- name: Output MPS versions
25+
id: mps_versions
26+
run: |
27+
mps_versions=$(jq <gradle.properties --compact-output --raw-input 'select(startswith("supportedMpsVersions=")) | split("=") | .[1] | split(",")')
28+
echo "mps_versions=$mps_versions" >> "$GITHUB_OUTPUT"
29+
30+
test:
31+
needs: assemble
32+
runs-on: ubuntu-latest
33+
strategy:
34+
matrix:
35+
mps_version: ${{ fromJSON(needs.assemble.outputs.mps_versions) }}
36+
steps:
37+
- uses: actions/checkout@v4
38+
- name: Set up JDK
39+
uses: actions/setup-java@v4
40+
with:
41+
distribution: 'temurin'
42+
java-version: '21'
43+
- name: Set up Gradle
44+
uses: gradle/actions/setup-gradle@v4
45+
- name: Test
46+
run: ./gradlew --no-daemon --no-parallel testMps${{ matrix.mps_version }}
47+
48+
# The job that acts as a required check for pull requests
49+
build:
50+
needs: test
51+
runs-on: ubuntu-latest

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ version.backend=1.24.2
44
version.project-loader=4.0.0
55

66
# A comma-separated list of MPS releases or prereleases to test against.
7+
# Also used in the GitHub workflow to test each version in parallel
78
supportedMpsVersions=2022.3.3,2023.2.2,2024.1.2,2024.3.1,251.23774.10091

0 commit comments

Comments
 (0)