Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: added ci workflows for pr and stage #1

Merged
merged 1 commit into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/auto-me-bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pr:
conventionalTitle:
signedCommits:
tasksList:
47 changes: 47 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Pull Request

on:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
name: Build and test Java ${{ matrix.java }}
permissions:
checks: write
pull-requests: write
env:
MAIN_JAVA_VER: 17
strategy:
matrix:
java: [17, 20]
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{ matrix.java }}
cache: maven

- name: Verify the project and create coverage report
run: mvn verify -Pits,cov -B -ff

- name: Report test summary
if: ${{ matrix.java == env.MAIN_JAVA_VER && always() }}
uses: EnricoMi/publish-unit-test-result-action@v2
with:
test_changes_limit: 0
files: ./target/junit-platform/TEST-junit-jupiter.xml

- name: Upload coverage reports
if: ${{ matrix.java == env.MAIN_JAVA_VER }}
uses: actions/upload-artifact@v3
with:
name: coverage
path: ./target/site/jacoco/jacoco.xml
37 changes: 37 additions & 0 deletions .github/workflows/stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Stage

on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- ".github/**"
- "**.md"

jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy snapshot
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Setup Java 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
cache: maven

- name: Get pom specs
id: project
run: |
echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> "$GITHUB_OUTPUT"

- name: Deploy snapshot to GitHub
if: contains(steps.project.outputs.version, 'SNAPSHOT')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn deploy -Pprepare-deployment,deploy-github -B -ff