Proposal 9191 #183
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: CI | |
on: | |
push: | |
branches-ignore: | |
- 'gh-pages' | |
- 'ci-generated' | |
pull_request: | |
branches-ignore: | |
- 'gh-pages' | |
- 'ci-generated' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew assemble | |
- name: Run the tests | |
run: ./gradlew check | |
reports_generate: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- name: Generate reports | |
run: | | |
chmod +x generate_rulesets.sh | |
./generate_rulesets.sh | |
- name: Upload reports artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: reports | |
path: generated | |
reports_deploy: | |
if: github.ref == 'refs/heads/main' | |
needs: reports_generate | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Fetch reports artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: reports | |
path: artifacts/reports | |
- name: Deploy reports to Github Pages | |
uses: crazy-max/ghaction-github-pages@v2.0.0 | |
with: | |
target_branch: ci-generated | |
keep_history: false | |
allow_empty_commit: false | |
build_dir: "artifacts/reports" | |
author: "ci-build <ci-build@agoranomic.org>" | |
commit_message: "CI Updates" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |