JavaAlgorithms/.github/workflows/build.yml

38 lines
1.1 KiB
YAML
Raw Permalink Normal View History

name: Build
2023-01-04 16:11:45 +08:00
on: [push, pull_request]
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:
- uses: actions/checkout@v4
2024-05-20 02:57:07 +08:00
- name: Set up JDK
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
- 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
with:
token: ${{ secrets.CODECOV_TOKEN }}
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