From b4afc92828d00b80b47a77b0b59a347c2c008916 Mon Sep 17 00:00:00 2001 From: Phillip Alday Date: Fri, 14 Apr 2023 15:43:53 +0000 Subject: [PATCH] Update CI to latest practices and fix broken test (#486) * use latest for CI * try again * add autocancel * more * separate cancellation group for docs * oops * remove buggy test * debug info * xx * find initial top of stack * remove debug statements --- .github/workflows/ci.yml | 16 ++++++---------- .github/workflows/docs.yml | 15 ++++++++------- test/runtests.jl | 11 ++++++----- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ebafa2fc..d38e1abd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,7 @@ name: CI +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true on: push: branches: [master] @@ -35,17 +38,10 @@ jobs: with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - uses: julia-actions/cache@v1 - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true - run: echo "LD_LIBRARY_PATH=$(R RHOME)/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV if: matrix.os == 'ubuntu-latest' - uses: julia-actions/julia-buildpkg@v1 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0fcfa908..f6f9d78c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,5 +1,7 @@ name: Documentation - +concurrency: + group: docs-${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true on: push: branches: @@ -12,13 +14,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true - run: echo "LD_LIBRARY_PATH=$(R RHOME)/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV - - uses: julia-actions/julia-buildpkg@latest - - name: Install dependencies - run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - - name: Make docs - run: julia --project=docs/ docs/make.jl + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-docdeploy@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DOCUMENTER_KEY: ${{ secrets.SSH_KEY }} diff --git a/test/runtests.jl b/test/runtests.jl index d0ae67f4..7e839d39 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,6 +1,10 @@ using RCall using Test +# before RCall does anything +const R_PPSTACKTOP_INITIAL = unsafe_load(cglobal((:R_PPStackTop, RCall.libR), Int)) +@info "" R_PPSTACKTOP_INITIAL + hd = homedir() if Sys.iswindows() @@ -61,8 +65,5 @@ end @info "" RCall.conda_provided_r -if !Sys.iswindows() # https://github.com/JuliaInterop/RCall.jl/pull/462 - if !RCall.conda_provided_r # this test will fail for the Conda-provided R - @test unsafe_load(cglobal((:R_PPStackTop, RCall.libR), Int)) == 0 - end -end +# make sure we're back where we started +@test unsafe_load(cglobal((:R_PPStackTop, RCall.libR), Int)) == R_PPSTACKTOP_INITIAL