update #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Java CI | |
| on: [push, pull_request] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'adopt' | |
| - name: Download JUnit Standalone JAR | |
| run: | | |
| mkdir lib | |
| wget -O lib/junit.jar https://repo1.maven.org/maven2/org/junit/platform/junit-platform-console-standalone/1.9.3/junit-platform-console-standalone-1.9.3.jar | |
| - name: Compile Java code with JUnit | |
| run: javac -cp "lib/junit.jar" -d out src/*.java test/*.java | |
| - name: Run tests | |
| run: | | |
| java -jar lib/junit.jar --classpath out --scan-classpath |