diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index d19800c..e48c8d4 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -1,50 +1,49 @@ name: Unit Tests - on: pull_request: - push: branches: - master - +permissions: + contents: read jobs: test-slurm: + runs-on: ${{ matrix.os }} timeout-minutes: 20 strategy: + fail-fast: false matrix: os: [ubuntu-latest] - julia_version: ["1.5", "nightly"] - julia_arch: [x64] - fail-fast: false - - runs-on: ${{ matrix.os }} - + julia_version: + - '1.2' # Oldest version of Julia that this package supports (according to Project.toml) + - '1.6' # Previous LTS + - '1.10' # Current LTS + - '1' # automatically expands to the latest stable 1.x release of Julia + - "nightly" env: SLURM: "latest" - steps: - - name: Checkout - uses: actions/checkout@v4.2.2 - - - uses: julia-actions/setup-julia@latest + - uses: actions/checkout@v4.2.2 + with: + persist-credentials: false + - uses: julia-actions/setup-julia@9b79636afcfb07ab02c256cede01fe2db6ba808c # v2.6.0 with: arch: ${{ matrix.julia_arch }} version: ${{ matrix.julia_version }} - + - name: Print Docker version + run: | + docker --version + docker version - name: Start Slurm Docker image run: | docker pull giovtorres/docker-centos7-slurm:$SLURM docker run -d -it -h ernie -v $(pwd):/SlurmTools -v $(julia -e 'print(dirname(Sys.BINDIR))'):/julia --name slurm-$SLURM giovtorres/docker-centos7-slurm:$SLURM - - name: Instantiate package run: docker exec slurm-$SLURM /julia/bin/julia --project=/SlurmTools -e 'using Pkg; Pkg.instantiate(verbose=true); Pkg.build(verbose=true)' - - name: Run tests without allocation run: docker exec slurm-$SLURM /julia/bin/julia --project=/SlurmTools -e 'using Pkg; Pkg.test(test_args=["slurm"])' - - name: Run tests inside allocation run: docker exec slurm-$SLURM salloc -t 00:10:00 -n 2 /julia/bin/julia --project=/SlurmTools -e 'using Pkg; Pkg.test(test_args=["slurm"])' - - name: Run tests inside sbatch run: | cat << EOF > sbatch.sh