Skip to content

Commit c9e4daa

Browse files
authored
Modify CI workflow for JDK 17 and add compile/run steps
Updated Java CI workflow to use JDK 17 and added steps to compile and run a Java program.
1 parent 8fe5ed1 commit c9e4daa

1 file changed

Lines changed: 15 additions & 14 deletions

File tree

.github/workflows/ant.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
# This workflow will build a Java project with Ant
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-ant
3-
41
name: Java CI
52

63
on:
74
push:
8-
branches: [ "main" ]
95
pull_request:
10-
branches: [ "main" ]
6+
workflow_dispatch:
117

128
jobs:
139
build:
14-
1510
runs-on: ubuntu-latest
1611

1712
steps:
18-
- uses: actions/checkout@v4
19-
- name: Set up JDK 11
20-
uses: actions/setup-java@v4
21-
with:
22-
java-version: '11'
23-
distribution: 'temurin'
24-
- name: Build with Ant
25-
run: ant -noinput -buildfile build.xml
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Java
17+
uses: actions/setup-java@v4
18+
with:
19+
distribution: "temurin"
20+
java-version: "17"
21+
22+
- name: Compile Java file
23+
run: javac Lib.java
24+
25+
- name: Run Java program
26+
run: echo "6" | java Lib

0 commit comments

Comments
 (0)