Skip to content

Commit

Permalink
revise CI scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Feb 9, 2024
1 parent 48e06fe commit 909485b
Show file tree
Hide file tree
Showing 11 changed files with 144 additions and 117 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
# https://github.com/JuliaRegistries/CompatHelper.jl
name: CompatHelper

on:
schedule:
- cron: '00 00 * * *'
- cron: '0 0 * * *' # every day at midnight
workflow_dispatch:

jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- uses: julia-actions/setup-julia@latest
- name: Check if Julia is already available
id: julia_in_path
run: which julia
continue-on-error: true
- name: Set up Julia if not already available
uses: julia-actions/setup-julia@v1
with:
version: '1'
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
arch: ${{ runner.arch }}
if: steps.julia_in_path.outcome != 'success'
- name: Install CompatHelper
run: julia -e 'import Pkg; Pkg.add("CompatHelper")'
- name: Run CompatHelper
run: |
julia -e 'import CompatHelper;
CompatHelper.main(; subdirs=["", "test", "docs"],
bump_compat_containing_equality_specifier=false)'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main(; subdirs=["", "test", "docs"], bump_compat_containing_equality_specifier=false)'
15 changes: 0 additions & 15 deletions .github/workflows/SpellCheck.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# https://github.com/JuliaRegistries/TagBot
name: TagBot

on:
issue_comment:
types:
- created
workflow_dispatch:

jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
- name: Create new release tag
uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
27 changes: 0 additions & 27 deletions .github/workflows/clean-gh-pages.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/doc-preview-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# https://documenter.juliadocs.org/stable/man/hosting/#Cleaning-up-gh-pages
name: Doc preview cleanup
on:
pull_request_target:
types: [closed]
workflow_dispatch:
jobs:
doc-preview-cleanup:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Delete preview and history
run: |
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})
git push --force origin gh-pages-new:gh-pages
fi
env:
PRNUM: ${{ github.event.number }}
23 changes: 14 additions & 9 deletions .github/workflows/docs.yml → .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,44 @@
# https://documenter.juliadocs.org/stable/man/hosting/#GitHub-Actions
name: Documentation

on:
push:
paths-ignore:
- 'LICENSE'
- 'README.md'
branches:
- master
tags: '*'
pull_request:
paths-ignore:
- 'LICENSE'
- 'README.md'
workflow_dispatch:

concurrency:
# cancel intermediate builds
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
env:
JULIA_PKG_SERVER: ''
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Julia
uses: julia-actions/setup-julia@latest
uses: julia-actions/setup-julia@v1
with:
version: '1'
- name: Check out repository
uses: actions/checkout@v4
- name: Cache artifacts
uses: julia-actions/cache@v1
- name: Install dependencies
run: |
julia --project=docs/ -e 'using Pkg;
Pkg.develop(PackageSpec(path=pwd()));
Pkg.instantiate()'
Pkg.develop(PackageSpec(path=pwd()));
Pkg.instantiate()'
- name: Build and deploy
run: julia --project=docs/ docs/make.jl
env:
GKSwstype: nul # fix for Plots with GR backend
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # authentication with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # authentication with SSH deploy key
run: julia --project=docs/ docs/make.jl
22 changes: 11 additions & 11 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name: Format
# https://github.com/julia-actions/julia-format
name: Format code
on:
schedule:
- cron: '0 0 * * 6' # every Saturday at 0:00
workflow_dispatch:
jobs:
build:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check out repository
uses: actions/checkout@v4
- name: Cache artifacts
uses: julia-actions/cache@v1
- name: Install JuliaFormatter and format
run: |
julia -e 'import Pkg; Pkg.add("JuliaFormatter")'
julia -e 'using JuliaFormatter; format(".")'
# https://github.com/marketplace/actions/create-pull-request
# https://github.com/peter-evans/create-pull-request#reference-example
- name: Create Pull Request
run: julia -e 'import Pkg; Pkg.add("JuliaFormatter"); using JuliaFormatter; format(".")'
- name: Create pull request
id: cpr
uses: peter-evans/create-pull-request@v5
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Format .jl files
Expand Down
67 changes: 36 additions & 31 deletions .github/workflows/invalidations.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,51 @@
# https://github.com/julia-actions/julia-invalidations
name: Invalidations

on:
pull_request:
paths-ignore:
- 'LICENSE'
- 'README.md'
workflow_dispatch:

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: always.
# cancel intermediate builds
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
evaluate:
# Only run on PRs to the default branch.
# In the PR trigger above branches can be specified only explicitly whereas this check should work for master, main, or any other default branch
if: github.base_ref == github.event.repository.default_branch
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
env:
JULIA_PKG_SERVER: ''
steps:
- uses: julia-actions/setup-julia@v1
with:
version: '1'

- uses: actions/checkout@v4
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-invalidations@v1
id: invs_pr

- uses: actions/checkout@v4
with:
ref: ${{ github.event.repository.default_branch }}
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-invalidations@v1
id: invs_default

- name: Report invalidation counts
run: |
echo "Invalidations on default branch: ${{ steps.invs_default.outputs.total }} (${{ steps.invs_default.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY
echo "This branch: ${{ steps.invs_pr.outputs.total }} (${{ steps.invs_pr.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY
- name: Check if the PR does increase number of invalidations
if: steps.invs_pr.outputs.total > steps.invs_default.outputs.total
run: exit 1
- name: Set up Julia
uses: julia-actions/setup-julia@v1
with:
version: '1'
# current branch
- name: Check out repository in current branch
uses: actions/checkout@v4
- name: Cache artifacts
uses: julia-actions/cache@v1
- name: Build package in current branch
uses: julia-actions/julia-buildpkg@v1
- name: Count invalidations in current branch
uses: julia-actions/julia-invalidations@v1
id: invs_branch
# default branch
- name: Check out repository in default branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.repository.default_branch }}
- name: Build package in default branch
uses: julia-actions/julia-buildpkg@v1
- name: Count invalidations in default branch
uses: julia-actions/julia-invalidations@v1
id: invs_default
# aggregate results
- name: Report invalidation counts
run: |
echo "Invalidations on default branch: ${{ steps.invs_default.outputs.total }} (${{ steps.invs_default.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY
echo "Invalidations on this branch: ${{ steps.invs_branch.outputs.total }} (${{ steps.invs_branch.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY
- name: Check whether branch increases invalidations
if: steps.invs_branch.outputs.total > steps.invs_default.outputs.total
run: exit 1
18 changes: 18 additions & 0 deletions .github/workflows/spell-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# https://github.com/crate-ci/typos
name: Spell check
on:
pull_request:
workflow_dispatch:
concurrency:
# cancel intermediate builds
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
spell-check:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Check spelling
uses: crate-ci/typos@master
13 changes: 8 additions & 5 deletions .github/workflows/ci.yml → .github/workflows/test-master.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: CI

# https://github.com/julia-actions/julia-runtest
name: Test
on:
push:
paths-ignore:
Expand All @@ -8,10 +8,13 @@ on:
branches:
- master
workflow_dispatch:

concurrency:
# cancel intermediate builds
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'skip ci')"
strategy:
Expand Down Expand Up @@ -42,6 +45,6 @@ jobs:
- name: Process coverage
uses: julia-actions/julia-processcoverage@v1
- name: Upload coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
files: lcov.info
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
name: CI-PR

# https://github.com/julia-actions/julia-runtest
name: Test
on:
pull_request:
paths-ignore:
- 'LICENSE'
- 'README.md'
workflow_dispatch:

concurrency:
# cancel intermediate builds
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'skip ci')"
strategy:
Expand Down Expand Up @@ -40,12 +43,12 @@ jobs:
uses: julia-actions/cache@v1
- name: Build package
uses: julia-actions/julia-buildpkg@v1
- name: Run tests
uses: julia-actions/julia-runtest@v1
continue-on-error: ${{ matrix.version == '1.6' }}
- name: Run tests
uses: julia-actions/julia-runtest@v1
continue-on-error: ${{ matrix.version == '1.6' }}
- name: Process coverage
uses: julia-actions/julia-processcoverage@v1
- name: Upload coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
files: lcov.info

0 comments on commit 909485b

Please sign in to comment.