From efa6b2c5d13037f3c86db17917f38582e7b4d5e4 Mon Sep 17 00:00:00 2001 From: David Widmann Date: Fri, 30 Aug 2024 00:51:55 +0200 Subject: [PATCH 1/2] Update GH actions config --- .github/dependabot.yml | 7 ++++++ .github/workflows/CI.yml | 33 +++++++++++-------------- .github/workflows/DocPreviewCleanup.yml | 23 +++++++++++------ .github/workflows/Docs.yml | 7 ++++-- 4 files changed, 42 insertions(+), 28 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..d60f0707 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" # Location of package manifests + schedule: + interval: "monthly" diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f585b09f..def7eb04 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -9,13 +9,17 @@ on: jobs: test: runs-on: ${{ matrix.os }} - continue-on-error: ${{ matrix.version == 'nightly' }} + continue-on-error: ${{ matrix.version == 'pre' }} + # needed to allow julia-actions/cache to delete old caches that it has created + permissions: + actions: write + contents: read strategy: matrix: version: - - '1.6' + - lts - '1' - - nightly + - pre os: - ubuntu-latest arch: @@ -31,23 +35,14 @@ jobs: os: macOS-latest arch: x64 steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 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/julia-buildpkg@latest - - uses: julia-actions/julia-runtest@latest + - 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 @@ -56,7 +51,9 @@ jobs: if: matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.arch == 'x64' with: file: lcov.info - - uses: coverallsapp/github-action@master + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + - uses: coverallsapp/github-action@v2 if: matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.arch == 'x64' with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/DocPreviewCleanup.yml b/.github/workflows/DocPreviewCleanup.yml index 15680241..b7b9b99e 100644 --- a/.github/workflows/DocPreviewCleanup.yml +++ b/.github/workflows/DocPreviewCleanup.yml @@ -4,25 +4,32 @@ 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@v2 + uses: actions/checkout@v4 with: ref: gh-pages - - name: Delete preview and history run: | - git config user.name "Documenter.jl" - git config user.email "documenter@juliadocs.github.io" - git rm -rf "previews/PR$PRNUM" - git commit -m "delete preview" - git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree}) + if [ -d "previews/PR$PRNUM" ]; then + git config user.name "Documenter.jl" + git config user.email "documenter@juliadocs.github.io" + git rm -rf "previews/PR$PRNUM" + git commit -m "delete preview" + git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree}) + fi env: PRNUM: ${{ github.event.number }} - - name: Push changes run: | git push --force origin gh-pages-new:gh-pages diff --git a/.github/workflows/Docs.yml b/.github/workflows/Docs.yml index 0400696b..7fab86ed 100644 --- a/.github/workflows/Docs.yml +++ b/.github/workflows/Docs.yml @@ -11,9 +11,12 @@ jobs: docs: name: Documentation runs-on: ubuntu-latest + permissions: + pull-requests: read # Required when using `push_preview=true` + statuses: write # Optional, used to report documentation build statuses steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 with: version: '1' - name: Install dependencies From 322c1fc067885ebfb78ded251fe399e49830cfbc Mon Sep 17 00:00:00 2001 From: David Widmann Date: Fri, 30 Aug 2024 11:24:14 +0200 Subject: [PATCH 2/2] Update .github/workflows/CI.yml --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index def7eb04..e89a3f00 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: version: - - lts + - '1.6' - '1' - pre os: