2021-09-26 17:26:59 +08:00
|
|
|
name: Build
|
2023-01-04 16:11:45 +08:00
|
|
|
on: [push, pull_request]
|
2024-04-06 23:06:30 +08:00
|
|
|
|
2020-10-24 16:48:33 +08:00
|
|
|
jobs:
|
2020-10-24 17:23:09 +08:00
|
|
|
build:
|
2020-10-24 16:48:33 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-05 03:21:39 +08:00
|
|
|
- uses: actions/checkout@v4
|
2024-05-20 02:57:07 +08:00
|
|
|
- name: Set up JDK
|
2024-03-22 19:06:58 +08:00
|
|
|
uses: actions/setup-java@v4
|
2020-10-24 16:48:33 +08:00
|
|
|
with:
|
2024-05-20 02:57:07 +08:00
|
|
|
java-version: 21
|
2021-12-07 14:22:28 +08:00
|
|
|
distribution: 'adopt'
|
|
|
|
- name: Build with Maven
|
|
|
|
run: mvn --batch-mode --update-snapshots verify
|
2024-04-07 02:50:15 +08:00
|
|
|
- name: Upload coverage to codecov (tokenless)
|
|
|
|
if: >-
|
|
|
|
github.event_name == 'pull_request' &&
|
|
|
|
github.event.pull_request.head.repo.full_name != github.repository
|
|
|
|
uses: codecov/codecov-action@v4
|
|
|
|
with:
|
|
|
|
fail_ci_if_error: true
|
|
|
|
- name: Upload coverage to codecov (with token)
|
|
|
|
if: >
|
|
|
|
github.repository == 'TheAlgorithms/Java' &&
|
|
|
|
(github.event_name != 'pull_request' ||
|
|
|
|
github.event.pull_request.head.repo.full_name == github.repository)
|
|
|
|
uses: codecov/codecov-action@v4
|
2024-04-06 23:06:30 +08:00
|
|
|
with:
|
2024-04-07 02:50:15 +08:00
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
2024-04-06 23:06:30 +08:00
|
|
|
fail_ci_if_error: true
|
2024-04-24 20:22:42 +08:00
|
|
|
- name: Checkstyle
|
|
|
|
run: mvn checkstyle:check
|
2024-04-28 16:31:11 +08:00
|
|
|
- name: SpotBugs
|
|
|
|
run: mvn spotbugs:check
|
2024-05-11 20:31:11 +08:00
|
|
|
- name: PMD
|
|
|
|
run: mvn pmd:check
|