diff --git a/.github/workflows/deploy_snapshot.yml b/.github/workflows/deploy_snapshot.yml new file mode 100644 index 00000000..628f66a7 --- /dev/null +++ b/.github/workflows/deploy_snapshot.yml @@ -0,0 +1,54 @@ +# (c) https://github.com/MontiCore/monticore +name: Deploy Snapshot + + +concurrency: # run this test workflow only once per "branch" + group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + push: # run this pipeline on every push + paths-ignore: + - "*.md" # do not run this pipeline if the only change was to markdown files + branches: [ "dev" ] # Only run on the default branch + 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 options passed to Gradle + GRADLE_BUILD_ACTION_CACHE_KEY_JOB: "test-cache-${{ github.head_ref }}.${{ github.sha }}" + +permissions: + contents: read + + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout project sources + uses: actions/checkout@v3 + - name: Gradle build + uses: gradle/actions/setup-gradle@v3 + with: + gradle-version: ${{env.GRADLE_VERSION}} + arguments: build ${{env.GRADLE_CLI_OPTS}} + + deploy: + permissions: + packages: write + runs-on: ubuntu-latest + needs: build + if: github.ref == 'refs/heads/dev' + steps: + - name: Checkout project sources + uses: actions/checkout@v3 + - name: Gradle publish + uses: gradle/actions/setup-gradle@v3 + with: + gradle-version: ${{env.GRADLE_VERSION}} + arguments: publish ${{env.GRADLE_CLI_OPTS}} -PmavenPassword=${{ secrets.SE_NEXUS_PASSWORD }} -PmavenUser=${{ secrets.SE_NEXUS_USER }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + diff --git a/.github/workflows/report_proposed_changes.yml b/.github/workflows/report_proposed_changes.yml new file mode 100644 index 00000000..4fb65213 --- /dev/null +++ b/.github/workflows/report_proposed_changes.yml @@ -0,0 +1,26 @@ +# (c) https://github.com/MontiCore/monticore +name: Report Proposed Changes Test Results +on: + workflow_run: + workflows: [ Test Proposed Changes ] + types: [ completed ] + +# Note: This is a separate workflow (file) to constrain the write permissions +permissions: + checks: write + +jobs: + checks: + runs-on: ubuntu-latest + steps: + - name: Download Test Report + uses: dawidd6/action-download-artifact@20319c5641d495c8a52e688b7dc5fada6c3a9fbc + with: + name: junit-test-results + workflow: ${{ github.event.workflow.id }} + run_id: ${{ github.event.workflow_run.id }} + - name: Publish Test Report + uses: mikepenz/action-junit-report@a451de5ac1ff45e46508b6150cb4f51a287d0309 + with: + commit: ${{github.event.workflow_run.head_sha}} + report_paths: '**/target/test-results/test/TEST-*.xml' diff --git a/.github/workflows/test_branch.yml b/.github/workflows/test_branch.yml new file mode 100644 index 00000000..35a0542a --- /dev/null +++ b/.github/workflows/test_branch.yml @@ -0,0 +1,43 @@ +# (c) https://github.com/MontiCore/monticore +name: Test Proposed Changes + +concurrency: # run this test workflow only once per "branch" + group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + push: # run this pipeline on every push + paths-ignore: + - "*.md" # do not run this pipeline if the only change was to markdown files + branches-ignore: [ "dev" ] # Do not run this on the default branch + +env: + GRADLE_VERSION: 7.4 # Gradle version used + GRADLE_CLI_OPTS: "-Pci --build-cache" # CLI options passed to Gradle + GRADLE_BUILD_ACTION_CACHE_KEY_JOB: "test-cache-${{ github.head_ref }}.${{ github.sha }}" + +permissions: + contents: read + + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout project sources + uses: actions/checkout@v3 + - name: Gradle build + uses: gradle/actions/setup-gradle@v3 + with: + gradle-version: ${{env.GRADLE_VERSION}} + arguments: build ${{env.GRADLE_CLI_OPTS}} + - name: Upload Test Report + uses: actions/upload-artifact@v3 + if: always() # always run even if the previous step fails + with: + name: junit-test-results + path: '**/target/test-results/test/TEST-*.xml' + retention-days: 1 + + + # Not a part of the MontiVerse \ No newline at end of file