LF8/.gitea/workflows/build.yml

48 lines
1.3 KiB
YAML
Raw Normal View History

name: Build
2024-09-26 10:08:24 +00:00
on: # test
2024-09-26 08:52:23 +00:00
pull_request:
2024-09-26 11:04:40 +00:00
types:
- opened
- reopened
- synchronize
- ready_for_review
push:
branches:
- main
jobs:
build:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 21
uses: actions/setup-java@v1
with:
java-version: 21
- name: Cache SonarQube packages
chore(deps): update actions/cache action to v4 (!19) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/cache](https://github.com/actions/cache) | action | major | `v1` -> `v4` | --- ### Release Notes <details> <summary>actions/cache (actions/cache)</summary> ### [`v4`](https://github.com/actions/cache/compare/v3...v4) [Compare Source](https://github.com/actions/cache/compare/v3...v4) ### [`v3`](https://github.com/actions/cache/compare/v2...v3) [Compare Source](https://github.com/actions/cache/compare/v2...v3) ### [`v2`](https://github.com/actions/cache/compare/v1...v2) [Compare Source](https://github.com/actions/cache/compare/v1...v2) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC45NS4wIiwidXBkYXRlZEluVmVyIjoiMzguOTUuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Reviewed-on: https://git.kjan.de/jank/LF8/pulls/19 Reviewed-by: Jan Gleytenhoover <krisellp9@gmail.com> Co-authored-by: Renovate <renovate@kjan.de> Co-committed-by: Renovate <renovate@kjan.de>
2024-09-26 05:25:14 +00:00
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
chore(deps): update actions/cache action to v4 (!19) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/cache](https://github.com/actions/cache) | action | major | `v1` -> `v4` | --- ### Release Notes <details> <summary>actions/cache (actions/cache)</summary> ### [`v4`](https://github.com/actions/cache/compare/v3...v4) [Compare Source](https://github.com/actions/cache/compare/v3...v4) ### [`v3`](https://github.com/actions/cache/compare/v2...v3) [Compare Source](https://github.com/actions/cache/compare/v2...v3) ### [`v2`](https://github.com/actions/cache/compare/v1...v2) [Compare Source](https://github.com/actions/cache/compare/v1...v2) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC45NS4wIiwidXBkYXRlZEluVmVyIjoiMzguOTUuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Reviewed-on: https://git.kjan.de/jank/LF8/pulls/19 Reviewed-by: Jan Gleytenhoover <krisellp9@gmail.com> Co-authored-by: Renovate <renovate@kjan.de> Co-committed-by: Renovate <renovate@kjan.de>
2024-09-26 05:25:14 +00:00
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Coverage
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
run: ./gradlew test jacocoTestReport sonar
- name: Build and analyze
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
2024-09-26 11:04:40 +00:00
run: ./gradlew build sonar --info