Skip to content

Commit

Permalink
Github Actions & Issues
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Lüpges <[email protected]>
  • Loading branch information
luepges committed Nov 4, 2024
1 parent 8d6446a commit 5169471
Show file tree
Hide file tree
Showing 16 changed files with 480 additions and 29 deletions.
70 changes: 70 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Bug Report
description: Report an issue with MontiCore
labels: [bug]
body:
- type: checkboxes
id: version
attributes:
label: Are you able replicate the bug in the latest version of MontiCore.
options:
- label: I am able to replicate the bug in the [latest version](https://github.com/MontiCore/monticore/releases) of MontiCore
required: true
- type: textarea
id: bugdesc
attributes:
label: Describe the bug
description: |
A clear and concise description of what the bug is
validations:
required: true
- type: textarea
id: steps_reproduce
attributes:
label: Steps to reproduce
description: Tell us how we can reproduce the issue
placeholder: |
1. Go to ...
2. Use the ...
3. See error
validations:
required: true
- type: input
id: expectedBehaviour
attributes:
label: Expected behaviour
description: |
A clear and concise description of what you expected to happen.
validations:
required: true
- type: textarea
id: project_reproduce
attributes:
label: Minimal reproducible example
description: If applicable, provide a minimal grammar/model/code or link to a GitHub project to reproduce your problem.
validations:
required: false
- type: input
id: ci
attributes:
label: Relevant CI workflow/pipeline
description: If applicable, provide a link to a CI artifact where this bug occurred.
validations:
required: false
- type: textarea
id: gradle_output
attributes:
label: Gradle Log
description: |
If applicable, add the Gradle's info log level output.
You can customize the log level using the `--info` options, i.e. `gradle build --info`.
This helps us determine your Java and Gradle versions.
validations:
required: false
- type: textarea
id: additional
attributes:
label: Additional information
description: Add any other context about the problem here
validations:
required: false
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: MontiCore handbook
url: https://www.monticore.de/handbook.pdf
about: The handbook gives an in-detail overview over a number of core mechanisms of MontiCore
- name: Teaching
url: https://www.se-rwth.de/teaching/
about: In case you are a student using MontiCore within a lecture, contact your teaching assistant in regards to exercises.
- name: More Information
url: https://monticore.github.io/monticore/#more-information-about-monticore
about: A list of additional resources about MontiCore
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Feature Request
description: Suggest an idea for the MontiCore language workbench
labels: ["feature:request"]
body:
- type: textarea
id: problem
attributes:
label: Is your feature request related to a problem? Please describe.
description: A clear and concise description of what the problem is.
placeholder: |
I'm always frustrated when ...
validations:
required: true
- type: textarea
id: suggestion
attributes:
label: Describe the solution you'd like?
description: Please described your feature request in as much detail as possible
placeholder: |
I would like to see ... added to MontiCore because ...
validations:
required: true
- type: input
id: alternatives
attributes:
label: Describe alternatives you've considered
description: |
A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false
- type: textarea
id: additional
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here
validations:
required: false
32 changes: 32 additions & 0 deletions .github/workflows/deploy_release_mc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# (c) https://github.com/MontiCore/monticore
name: Publish a Release

on:
release:
types:
- created

permissions:
contents: read
packages: write

env:
GRADLE_VERSION: 7.4 # Gradle version used
GRADLE_CLI_OPTS: "-Pci" # CLI option passed to Gradle

jobs:
# Deploy the current tag as a release
deploy-release:
runs-on: ubuntu-latest
steps:
- name: Checkout project sources
uses: actions/checkout@v3
- name: Gradle DeployMC
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: ${{env.GRADLE_VERSION}}
# pass the tag as the version property (${{ github.ref_name }})
arguments: deployMC ${{env.GRADLE_CLI_OPTS}} -PmavenPassword=${{env.MAVEN_PASSWORD}} -PmavenUser=${{env.MAVEN_USER}} -PgenEMF=true -PgenTR=true -PgenTagging=true -Pversion=${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# TODO: Create and publish the monticore.tar.gz
58 changes: 58 additions & 0 deletions .github/workflows/deploy_snapshot_mc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# (c) https://github.com/MontiCore/monticore
# This workflow publishes the jar of a (GitHub) publication, and then triggers downstream projects
name: Gradle Deploy Snapshot

concurrency: # run this deploy workflow only once per repository
group: ${{ github.repository }}-${{ github.workflow }}
cancel-in-progress: true

on:
workflow_run: # Note: This event will only trigger a workflow run if the workflow file is on the default branch
workflows: [ Gradle Test & Build ]
branches: [ dev ]
types:
- completed

permissions:
contents: read
packages: write

env:
GRADLE_VERSION: 7.4 # Gradle version used
GRADLE_CLI_OPTS: "-Pci" # CLI option passed to Gradle

jobs:
# Deploy the snapshot-publications to the snapshot repository (both nexus and GitHub Packages)
deploy-snapshot:
if: ${{ github.event.workflow_run.conclusion == 'success' }} # only run if tests were successful
runs-on: ubuntu-latest
steps:
- name: Checkout project sources
uses: actions/checkout@v3
- name: Deploy the snapshot
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: ${{env.GRADLE_VERSION}}
arguments: deployMC ${{env.GRADLE_CLI_OPTS}} -PmavenPassword=${{env.MAVEN_PASSWORD}} -PmavenUser=${{env.MAVEN_USER}} -PgenEMF=true -PgenTR=true -PgenTagging=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Trigger GitHub downstream projects (without reporting the pipeline result)
trigger-github-downstream:
needs: [ deploy-snapshot ]
runs-on: ubuntu-latest
strategy:
matrix:
project: [ "MontiCore/statecharts" ]
steps:
- name: Trigger ${{ matrix.project }}
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.DOWNSTREAM_PAT }}
repository: ${{ matrix.project }}
event-type: trigger_after_upstream_deploy

# We do not trigger (internal) GitLab downstream projects


# TODO: Trigger correct Downstream Projects (both on GitHub and GitLab)
158 changes: 158 additions & 0 deletions .github/workflows/gradle_mc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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
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
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.client_payload && github.ref != 'refs/heads/dev'}} # do not run on upstream-changes or default branch
runs-on: ubuntu-latest
needs: [ build-mc ]
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.ref}}"}'

# 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
3 changes: 2 additions & 1 deletion .github/workflows/prepare_pages.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# .github/workflows/prepare_pages.yml
# (c) https://github.com/MontiCore/monticore
name: Prepare And Deploy Pages

# Preprocess the docs, build a site directory and push its contents to the gh-pages branch
Expand All @@ -10,6 +10,7 @@ on:

jobs:
build:
if: false # TODO: RE-ENABLE
runs-on: ubuntu-latest
env:
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
Expand Down
Loading

0 comments on commit 5169471

Please sign in to comment.