Skip to content

Commit 081047e

Browse files
authored
Add MontiVerse CI
1 parent 901a188 commit 081047e

File tree

3 files changed

+129
-52
lines changed

3 files changed

+129
-52
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,53 @@
1-
# (c) https://github.com/MontiCore/monticore
2-
name: Gradle
3-
4-
5-
concurrency: # run this test workflow only once per "branch"
6-
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
7-
cancel-in-progress: true
8-
9-
on:
10-
push: # run this test pipeline on every push
11-
pull_request: # and pull request
12-
repository_dispatch: # and on request of upstream projects
13-
types: [ trigger_after_upstream_deploy ]
14-
15-
16-
env:
17-
GRADLE_VERSION: 7.4 # Gradle version used
18-
GRADLE_CLI_OPTS: "-Pci --build-cache " # CLI options passed to Gradle
19-
20-
permissions:
21-
contents: read # This action may run somewhat unsafe code
22-
23-
24-
jobs:
25-
build:
26-
runs-on: ubuntu-latest
27-
steps:
28-
- name: Checkout project sources
29-
uses: actions/checkout@v3
30-
- name: Gradle build
31-
uses: gradle/actions/setup-gradle@v3
32-
with:
33-
gradle-version: ${{env.GRADLE_VERSION}}
34-
arguments: build ${{env.GRADLE_CLI_OPTS}}
35-
36-
deploy:
37-
permissions:
38-
packages: write
39-
runs-on: ubuntu-latest
40-
needs: build
41-
if: github.ref == 'refs/heads/dev'
42-
steps:
43-
- name: Checkout project sources
44-
uses: actions/checkout@v3
45-
- name: Gradle publish
46-
uses: gradle/actions/setup-gradle@v3
47-
with:
48-
gradle-version: ${{env.GRADLE_VERSION}}
49-
arguments: publish ${{env.GRADLE_CLI_OPTS}} -PmavenPassword=${{ secrets.SE_NEXUS_PASSWORD }} -PmavenUser=${{ secrets.SE_NEXUS_USER }}
50-
env:
51-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52-
1+
# (c) https://github.com/MontiCore/monticore
2+
name: Deploy Snapshot
3+
4+
5+
concurrency: # run this test workflow only once per "branch"
6+
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
9+
on:
10+
push: # run this pipeline on every push
11+
paths-ignore:
12+
- "*.md" # do not run this pipeline if the only change was to markdown files
13+
branches: [ "dev" ] # Only run on the default branch
14+
repository_dispatch: # and on request of upstream projects
15+
types: [ trigger_after_upstream_deploy ]
16+
17+
env:
18+
GRADLE_VERSION: 7.4 # Gradle version used
19+
GRADLE_CLI_OPTS: "-Pci --build-cache" # CLI options passed to Gradle
20+
GRADLE_BUILD_ACTION_CACHE_KEY_JOB: "test-cache-${{ github.head_ref }}.${{ github.sha }}"
21+
22+
permissions:
23+
contents: read
24+
25+
26+
jobs:
27+
build:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout project sources
31+
uses: actions/checkout@v3
32+
- name: Gradle build
33+
uses: gradle/actions/setup-gradle@v3
34+
with:
35+
gradle-version: ${{env.GRADLE_VERSION}}
36+
arguments: build ${{env.GRADLE_CLI_OPTS}}
37+
38+
deploy:
39+
permissions:
40+
packages: write
41+
runs-on: ubuntu-latest
42+
needs: build
43+
if: github.ref == 'refs/heads/dev'
44+
steps:
45+
- name: Checkout project sources
46+
uses: actions/checkout@v3
47+
- name: Gradle publish
48+
uses: gradle/actions/setup-gradle@v3
49+
with:
50+
gradle-version: ${{env.GRADLE_VERSION}}
51+
arguments: publish ${{env.GRADLE_CLI_OPTS}} -PmavenPassword=${{ secrets.SE_NEXUS_PASSWORD }} -PmavenUser=${{ secrets.SE_NEXUS_USER }}
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# (c) https://github.com/MontiCore/monticore
2+
name: Report Proposed Changes Test Results
3+
on:
4+
workflow_run:
5+
workflows: [ Test Proposed Changes ]
6+
types: [ completed ]
7+
8+
# Note: This is a separate workflow (file) to constrain the write permissions
9+
permissions:
10+
checks: write
11+
12+
jobs:
13+
checks:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Download Test Report
17+
uses: dawidd6/action-download-artifact@20319c5641d495c8a52e688b7dc5fada6c3a9fbc
18+
with:
19+
name: junit-test-results
20+
workflow: ${{ github.event.workflow.id }}
21+
run_id: ${{ github.event.workflow_run.id }}
22+
- name: Publish Test Report
23+
uses: mikepenz/action-junit-report@a451de5ac1ff45e46508b6150cb4f51a287d0309
24+
with:
25+
commit: ${{github.event.workflow_run.head_sha}}
26+
report_paths: '**/target/test-results/test/TEST-*.xml'

.github/workflows/test_branch.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# (c) https://github.com/MontiCore/monticore
2+
name: Test Proposed Changes
3+
4+
concurrency: # run this test workflow only once per "branch"
5+
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
6+
cancel-in-progress: true
7+
8+
on:
9+
push: # run this pipeline on every push
10+
paths-ignore:
11+
- "*.md" # do not run this pipeline if the only change was to markdown files
12+
branches-ignore: [ "dev" ] # Do not run this on the default branch
13+
14+
env:
15+
GRADLE_VERSION: 7.4 # Gradle version used
16+
GRADLE_CLI_OPTS: "-Pci --build-cache" # CLI options passed to Gradle
17+
GRADLE_BUILD_ACTION_CACHE_KEY_JOB: "test-cache-${{ github.head_ref }}.${{ github.sha }}"
18+
19+
permissions:
20+
contents: read
21+
22+
23+
jobs:
24+
build:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout project sources
28+
uses: actions/checkout@v3
29+
- name: Gradle build
30+
uses: gradle/actions/setup-gradle@v3
31+
with:
32+
gradle-version: ${{env.GRADLE_VERSION}}
33+
arguments: build ${{env.GRADLE_CLI_OPTS}}
34+
- name: Upload Test Report
35+
uses: actions/upload-artifact@v3
36+
if: always() # always run even if the previous step fails
37+
with:
38+
name: junit-test-results
39+
path: '**/target/test-results/test/TEST-*.xml'
40+
retention-days: 1
41+
42+
43+
# Run the MontiVerse pipeline (tests this change on a suite of projects)
44+
trigger-montiverse:
45+
needs: [ build ]
46+
uses: MontiCore/monticore/.github/workflows/call_montiverse_branch.yml@dev
47+
with:
48+
project: "XML"
49+
secrets: inherit
50+

0 commit comments

Comments
 (0)