This repository was archived by the owner on Jun 18, 2026. It is now read-only.
ci: bump actions/checkout from 4 to 6 #767
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: CI | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| java-version: [11, 17] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up JDK ${{ matrix.java-version }} | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: ${{ matrix.java-version }} | |
| distribution: temurin | |
| - name: Download JUnit | |
| run: | | |
| mkdir -p Gvisual/lib/test | |
| curl -sL -o Gvisual/lib/test/junit-4.13.2.jar \ | |
| https://repo1.maven.org/maven2/junit/junit/4.13.2/junit-4.13.2.jar | |
| curl -sL -o Gvisual/lib/test/hamcrest-core-1.3.jar \ | |
| https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar | |
| - name: Compile source | |
| working-directory: Gvisual | |
| run: | | |
| set -e | |
| mkdir -p build/classes | |
| # Production sources only: anything under src/ that is NOT a *Test.java | |
| # (some test files are checked in under src/ alongside production code). | |
| # We still want them on the test classpath later, but they must not | |
| # be compiled with javac without junit on the path. | |
| find src -name '*.java' ! -name '*Test.java' > sources.txt | |
| MAIN_CP="$(find lib -name '*.jar' -not -path 'lib/test/*' | tr '\n' ':')" | |
| javac -encoding UTF-8 \ | |
| -source 11 -target 11 \ | |
| -cp "$MAIN_CP" \ | |
| -d build/classes \ | |
| @sources.txt | |
| - name: Compile tests | |
| working-directory: Gvisual | |
| run: | | |
| set -e | |
| mkdir -p build/test/classes | |
| # *Test.java files in the canonical Maven test dir only. A handful | |
| # of stale test stubs live under src/test/ from earlier scaffolding; | |
| # they are ignored here so they don't break CI when their target | |
| # production APIs drift. | |
| find test -name '*Test.java' > test-sources.txt | |
| TEST_CP="build/classes:$(find lib -name '*.jar' | tr '\n' ':')" | |
| javac -encoding UTF-8 \ | |
| -source 11 -target 11 \ | |
| -cp "$TEST_CP" \ | |
| -d build/test/classes \ | |
| @test-sources.txt | |
| - name: Run tests | |
| working-directory: Gvisual | |
| run: | | |
| java -cp "build/classes:build/test/classes:$(find lib -name '*.jar' | tr '\n' ':')" \ | |
| org.junit.runner.JUnitCore \ | |
| app.UtilMethodsTest \ | |
| gvisual.EdgeTest \ | |
| gvisual.EdgeTypeTest \ | |
| gvisual.QuadTreeTest \ | |
| gvisual.GraphStatsTest \ | |
| gvisual.GraphMLExporterTest \ | |
| gvisual.CommunityDetectorTest \ | |
| gvisual.NodeCentralityAnalyzerTest \ | |
| gvisual.ArticulationPointAnalyzerTest \ | |
| gvisual.GraphRegularityAnalyzerTest \ | |
| gvisual.GraphPowerCalculatorTest \ | |
| gvisual.WienerIndexCalculatorTest \ | |
| gvisual.GraphIsomorphismCheckerTest \ | |
| gvisual.GraphFileParserTest \ | |
| gvisual.TreewidthAnalyzerTest |