Skip to content

Commit 625737d

Browse files
committed
GitHub Actions (CI/CD)
1 parent 6546248 commit 625737d

File tree

1 file changed

+8
-32
lines changed

1 file changed

+8
-32
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,16 @@
1-
name: Build
2-
on: [push, pull_request]
1+
name: Java CI
32

4-
permissions:
5-
contents: read
3+
on: [push]
64

75
jobs:
86
build:
97
runs-on: ubuntu-latest
108
steps:
11-
- uses: actions/checkout@v5
9+
- uses: actions/checkout@v2
1210
- name: Set up JDK
13-
uses: actions/setup-java@v4
11+
uses: actions/setup-java@v2
1412
with:
15-
java-version: 21
16-
distribution: 'temurin'
17-
- name: Build with Maven
18-
run: mvn --batch-mode --update-snapshots verify
19-
- name: Upload coverage to codecov (tokenless)
20-
if: >-
21-
github.event_name == 'pull_request' &&
22-
github.event.pull_request.head.repo.full_name != github.repository
23-
uses: codecov/codecov-action@v5
24-
with:
25-
fail_ci_if_error: true
26-
- name: Upload coverage to codecov (with token)
27-
if: >
28-
github.repository == 'TheAlgorithms/Java' &&
29-
(github.event_name != 'pull_request' ||
30-
github.event.pull_request.head.repo.full_name == github.repository)
31-
uses: codecov/codecov-action@v5
32-
with:
33-
token: ${{ secrets.CODECOV_TOKEN }}
34-
fail_ci_if_error: true
35-
- name: Checkstyle
36-
run: mvn checkstyle:check
37-
- name: SpotBugs
38-
run: mvn spotbugs:check
39-
- name: PMD
40-
run: mvn pmd:check
13+
java-version: "17"
14+
distribution: "temurin"
15+
- name: Build with javac
16+
run: javac *.java

0 commit comments

Comments
 (0)