Add Forgejo workflow
This commit is contained in:
parent
5941aaab38
commit
e18199304f
1 changed files with 77 additions and 0 deletions
77
.forgejo/workflows/pull_request.yml
Normal file
77
.forgejo/workflows/pull_request.yml
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
name: Build & Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
validate:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Validate
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: set up JDK
|
||||||
|
uses: https://git.wbrawner.com/actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
distribution: 'zulu'
|
||||||
|
java-version: '17'
|
||||||
|
- name: Validate Gradle Wrapper
|
||||||
|
uses: gradle/wrapper-validation-action@v1
|
||||||
|
- name: Enable auto-merge
|
||||||
|
if: ${{ github.event_name == 'pull_request' && github.actor == 'dependabot' }}
|
||||||
|
run: gh pr merge --auto --rebase "$PR_URL"
|
||||||
|
env:
|
||||||
|
PR_URL: ${{github.event.pull_request.html_url}}
|
||||||
|
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
unit_test:
|
||||||
|
name: Run Unit Tests
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- validate
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: set up JDK
|
||||||
|
uses: https://git.wbrawner.com/actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
distribution: 'zulu'
|
||||||
|
java-version: '17'
|
||||||
|
- name: Run unit tests
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
with:
|
||||||
|
arguments: testPlayDebugUnitTest
|
||||||
|
- name: Publish JUnit Results
|
||||||
|
uses: dorny/test-reporter@v1
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
name: Unit Test Results
|
||||||
|
path: "*/build/test-results/*/*.xml"
|
||||||
|
reporter: java-junit
|
||||||
|
fail-on-error: true
|
||||||
|
ui_tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Run UI Tests
|
||||||
|
needs:
|
||||||
|
- validate
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: set up JDK
|
||||||
|
uses: https://git.wbrawner.com/actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
distribution: 'zulu'
|
||||||
|
java-version: '17'
|
||||||
|
- name: Build with Gradle
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
with:
|
||||||
|
arguments: assemblePlayDebug assemblePlayDebugAndroidTest
|
||||||
|
- name: Grant execute permission for flank_auth.sh
|
||||||
|
run: chmod +x flank_auth.sh
|
||||||
|
- name: Add auth for flank
|
||||||
|
env:
|
||||||
|
GCLOUD_KEY: ${{ secrets.GCLOUD_KEY }}
|
||||||
|
run: |
|
||||||
|
./flank_auth.sh
|
||||||
|
- name: Run UI tests
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
with:
|
||||||
|
arguments: runFlank
|
Loading…
Reference in a new issue