Feature/merge rev219 #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: OpenOSRS - CI (PR) | |
on: | |
pull_request: | |
types: ['opened', 'edited', 'reopened', 'synchronize'] | |
jobs: | |
pr-lint: | |
name: PR title | |
runs-on: ubuntu-latest | |
steps: | |
- name: PR title lint | |
if: github.event_name == 'pull_request' | |
uses: MorrisonCole/[email protected] | |
with: | |
title-regex: '^([\w-/]+): \w+' | |
on-failed-regex-fail-action: false | |
on-failed-regex-request-changes: false | |
on-failed-regex-create-review: true | |
on-failed-regex-comment: "Your PR title should match the following regex: `%regex%`!" | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
validate: | |
name: Validate gradle wrapper | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: gradle/[email protected] | |
build: | |
name: Build | |
needs: [pr-lint, validate] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Make gradlew executable | |
run: chmod +x ./gradlew | |
- name: Set up JDK 11 | |
uses: actions/[email protected] | |
with: | |
distribution: 'adopt' | |
java-version: 11 | |
cache: 'gradle' | |
- name: Assembling | |
run: ./gradlew assemble --console=plain | |
- name: Building | |
run: ./gradlew build --stacktrace -x test -x checkstyleMain -x checkstyleTest --console=plain | |
test: | |
name: Test | |
needs: [pr-lint, validate] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Make gradlew executable | |
run: chmod +x ./gradlew | |
- name: Set up JDK 11 | |
uses: actions/[email protected] | |
with: | |
distribution: 'adopt' | |
java-version: 11 | |
cache: 'gradle' | |
- name: Assembling | |
run: ./gradlew assemble --console=plain | |
- name: Testing | |
run: ./gradlew test -x deobfuscator:test --stacktrace --console=plain | |
checkstyleMain: | |
name: Checkstyle main | |
needs: [pr-lint, validate] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Make gradlew executable | |
run: chmod +x ./gradlew | |
- name: Set up JDK 11 | |
uses: actions/[email protected] | |
with: | |
distribution: 'adopt' | |
java-version: 11 | |
cache: 'gradle' | |
- name: Assembling | |
run: ./gradlew assemble --console=plain | |
- name: Checking code conventions | |
run: ./gradlew checkstyleMain --console=plain | |
checkstyleTest: | |
name: Checkstyle test | |
needs: [pr-lint, validate] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Make gradlew executable | |
run: chmod +x ./gradlew | |
- name: Set up JDK 11 | |
uses: actions/[email protected] | |
with: | |
distribution: 'adopt' | |
java-version: 11 | |
cache: 'gradle' | |
- name: Assembling | |
run: ./gradlew assemble --console=plain | |
- name: Checking code conventions | |
run: ./gradlew checkstyleTest --console=plain | |
approve: | |
name: Approve | |
needs: [build, test, checkstyleMain, checkstyleTest] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Approve pull request | |
if: github.event_name == 'pull_request' && github.actor == 'OpenOSRS' | |
uses: hmarr/[email protected] | |
with: | |
github-token: ${{ secrets.Owain }} |