From 481bf4daf2c1ddd6dbe999e6beb07b2aa70cdb00 Mon Sep 17 00:00:00 2001 From: Oliver Schulz Date: Thu, 21 Nov 2024 13:42:48 +0100 Subject: [PATCH] Update CI --- .github/workflows/CompatHelper.yml | 4 +- .github/workflows/DocPreviewCleanup.yml | 33 +++++++++++++ .github/workflows/ci.yml | 63 +++++++++---------------- 3 files changed, 56 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/DocPreviewCleanup.yml diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml index 7ddad2a..8ad0284 100644 --- a/.github/workflows/CompatHelper.yml +++ b/.github/workflows/CompatHelper.yml @@ -15,10 +15,10 @@ jobs: run: which julia continue-on-error: true - name: Install Julia, but only if it is not already available in the PATH - uses: julia-actions/setup-julia@v1 + uses: julia-actions/setup-julia@v2 with: version: '1' - # arch: ${{ runner.arch }} + arch: ${{ runner.arch }} if: steps.julia_in_path.outcome != 'success' - name: "Add the General registry via Git" run: | diff --git a/.github/workflows/DocPreviewCleanup.yml b/.github/workflows/DocPreviewCleanup.yml new file mode 100644 index 0000000..5be23b9 --- /dev/null +++ b/.github/workflows/DocPreviewCleanup.yml @@ -0,0 +1,33 @@ +name: Doc Preview Cleanup + +on: + pull_request: + types: [closed] + +# Ensure that only one "Doc Preview Cleanup" workflow is force pushing at a time +concurrency: + group: doc-preview-cleanup + cancel-in-progress: false + +jobs: + doc-preview-cleanup: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout gh-pages branch + uses: actions/checkout@v4 + with: + ref: gh-pages + - name: Delete preview and history + push changes + run: | + if [ -d "${preview_dir}" ]; then + git config user.name "Documenter.jl" + git config user.email "documenter@juliadocs.github.io" + git rm -rf "${preview_dir}" + git commit -m "delete preview" + git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree}) + git push --force origin gh-pages-new:gh-pages + fi + env: + preview_dir: previews/PR${{ github.event.number }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c962708..7d09e6b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,72 +27,51 @@ jobs: version: - '1.10' - '1' + - 'pre' os: - ubuntu-latest arch: - x64 include: + - version: 1 + os: ubuntu-latest + arch: x86 - version: 1 os: macOS-latest arch: x64 + - version: 1 + os: windows-latest + arch: x64 steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@latest + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - name: Cache artifacts - uses: actions/cache@v2 - 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 }}- - - name: registry_add - run: julia add_registries.jl - - uses: julia-actions/julia-buildpkg@latest - env: - PYTHON: 'Conda' - - uses: julia-actions/julia-runtest@latest - env: - DATADEPS_ALWAYS_ACCEPT: 'true' + - uses: julia-actions/cache@v2 + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 with: coverage: ${{ matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.arch == 'x64' }} - uses: julia-actions/julia-processcoverage@v1 if: matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.arch == 'x64' - - uses: codecov/codecov-action@v1 + - uses: codecov/codecov-action@v5 if: matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.arch == 'x64' with: - file: lcov.info + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + files: lcov.info docs: name: Documentation runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@latest + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 with: version: '1' - - name: Cache artifacts - uses: actions/cache@v2 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/docs/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- - - name: registry_add - run: julia add_registries.jl - - uses: julia-actions/julia-buildpkg@latest - env: - PYTHON: 'Conda' - - uses: julia-actions/julia-docdeploy@latest + - uses: julia-actions/cache@v2 + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-docdeploy@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed due to https://github.com/JuliaDocs/Documenter.jl/issues/1177