name: Julia Test on: [push] jobs: julia-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Julia uses: julia-actions/setup-julia@v1 with: version: '1.10' - name: Install dependencies (if Project.toml exists) shell: bash run: | if [ -f Project.toml ]; then julia -e 'using Pkg; Pkg.instantiate()' else echo "No Project.toml found; will create a minimal project for testing." fi - name: Run tests or Hello shell: bash run: | set -euo pipefail if [ -f Project.toml ]; then # Activate the repo project and run its tests julia -e 'using Pkg; Pkg.activate("."); Pkg.test()' else # Create a tiny project + test so the job still proves the runner works mkdir -p test cat > Project.toml <<'EOF' name = "HelloCI" uuid = "f0f9c0b0-0000-4e00-9000-000000000001" version = "0.1.0" [deps] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" EOF cat > test/runtests.jl <<'EOF' using Test @test 2 + 2 == 4 println("Hello, Julia!") EOF julia -e 'using Pkg; Pkg.activate("."); Pkg.test()' fi