Skip to content

Commit

Permalink
workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
BLCK-B committed Aug 7, 2024
1 parent 8bb87bc commit 11897f2
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/PR-dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Dependabot auto-approve
on: pull_request

permissions:
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve a PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42 changes: 42 additions & 0 deletions .github/workflows/test-then-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Java CI with Gradle

on:
push:
branches: [ "dev" ]
pull_request:
branches: [ "dev" ]

jobs:
gradle-test-build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: current
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Run tests
run: |
./gradlew test --info
if [ $? -ne 0 ]; then exit 1; fi
- name: Fail job if tests failed
if: failure()
run: echo "Tests failed, stopping the job"
- name: Build with Gradle Wrapper
run: ./gradlew build
- name: Upload JAR artifact
uses: actions/upload-artifact@v4
with:
name: MRT-artifact
path: build/libs/*.jar
retention-days: 7
overwrite: true

0 comments on commit 11897f2

Please sign in to comment.