Skip to content

Commit

Permalink
ci(github-actions): add workflows for subpackages
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Sep 17, 2024
1 parent 1808553 commit 734b2f8
Show file tree
Hide file tree
Showing 6 changed files with 220 additions and 75 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/CI_BracketingNonlinearSolve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: CI (BracketingNonlinearSolve)

on:
pull_request:
branches:
- master
paths:
- "lib/BracketingNonlinearSolve/src/**"
- "lib/BracketingNonlinearSolve/ext/**"
- "lib/BracketingNonlinearSolve/test/**"
- "lib/BracketingNonlinearSolve/Project.toml"
- ".github/workflows/CI_BracketingNonlinearSolve.yml"
push:
branches:
- master

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- "min"
- "1"
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
- uses: actions/cache@v4
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: "Install Dependencies and Run Tests"
run: |
import Pkg
Pkg.Registry.update()
# Install packages present in subdirectories
for path in ("lib/NonlinearSolveBase",)
Pkg.develop(; path)
end
Pkg.instantiate()
Pkg.test(; coverage=true)
shell: julia --color=yes --code-coverage=user --depwarn=yes --project=lib/BracketingNonlinearSolve {0}
- uses: julia-actions/julia-processcoverage@v1
with:
directories: lib/BracketingNonlinearSolve/src,lib/BracketingNonlinearSolve/ext
- uses: codecov/codecov-action@v4
with:
file: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
fail_ci_if_error: true
73 changes: 73 additions & 0 deletions .github/workflows/CI_NonlinearSolve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: CI (NonlinearSolve)

on:
pull_request:
branches:
- master
paths:
- "src/**"
- "ext/**"
- "test/**"
- "Project.toml"
- ".github/workflows/CI_NonlinearSolve.yml"
push:
branches:
- master

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
group:
- Core
- Downstream
- Misc
- Wrappers
version:
- "min"
- "1"
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- name: "Stub"
run: echo "Remember to uncomment the following steps!!!!!!!!"
# - uses: actions/checkout@v4
# - uses: julia-actions/setup-julia@v2
# with:
# version: ${{ matrix.version }}
# - uses: actions/cache@v4
# 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@v1
# - uses: julia-actions/julia-runtest@v1
# env:
# GROUP: ${{ matrix.group }}
# JULIA_NUM_THREADS: 11
# RETESTITEMS_NWORKERS: 4
# RETESTITEMS_NWORKER_THREADS: 2
# - uses: julia-actions/julia-processcoverage@v1
# with:
# directories: src,ext
# - uses: codecov/codecov-action@v4
# with:
# file: lcov.info
# token: ${{ secrets.CODECOV_TOKEN }}
# verbose: true
# fail_ci_if_error: true
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: CI
name: CI (NonlinearSolveBase)

on:
pull_request:
branches:
- master
paths:
- "src/**"
- "ext/**"
- "test/**"
- "Project.toml"
- ".github/workflows/CI.yml"
- "lib/NonlinearSolveBase/src/**"
- "lib/NonlinearSolveBase/ext/**"
- "lib/NonlinearSolveBase/test/**"
- "lib/NonlinearSolveBase/Project.toml"
- ".github/workflows/CI_NonlinearSolveBase.yml"
push:
branches:
- master
Expand All @@ -26,17 +26,13 @@ jobs:
strategy:
fail-fast: false
matrix:
group:
- Core
- Downstream
- Misc
- Wrappers
version:
- "1"
- "min"
# - "1"
os:
- ubuntu-latest
- macos-latest
- windows-latest
# - macos-latest
# - windows-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
Expand All @@ -52,16 +48,16 @@ jobs:
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
env:
GROUP: ${{ matrix.group }}
JULIA_NUM_THREADS: 11
RETESTITEMS_NWORKERS: 4
RETESTITEMS_NWORKER_THREADS: 2
- name: "Install Dependencies and Run Tests"
run: |
import Pkg
Pkg.Registry.update()
Pkg.instantiate()
Pkg.test(; coverage=true)
shell: julia --color=yes --code-coverage=user --depwarn=yes --project=lib/NonlinearSolveBase {0}
- uses: julia-actions/julia-processcoverage@v1
with:
directories: src,ext
directories: lib/NonlinearSolveBase/src,lib/NonlinearSolveBase/ext
- uses: codecov/codecov-action@v4
with:
file: lcov.info
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@ jobs:
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: julia -e 'using CompatHelper; CompatHelper.main(;subdirs=["", "docs"])'
run: |
import CompatHelper
subdirs = ["", "docs"]
append!(subdirs, joinpath.(("lib",), filter(p -> isdir(joinpath("lib", p)), readdir("lib"))))
CompatHelper.main(; subdirs)
shell: julia --color=yes {0}
working-directory: "./"
24 changes: 11 additions & 13 deletions .github/workflows/Downgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@ jobs:
matrix:
version: ["1"]
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
- uses: julia-actions/julia-downgrade-compat@v1
with:
skip: Pkg,TOML
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
env:
JULIA_NUM_THREADS: 11
RETESTITEMS_NWORKERS: 4
RETESTITEMS_NWORKER_THREADS: 2
- name: "Stub"
run: echo "Remember to uncomment the following steps!!!!!!!!"
# - uses: actions/checkout@v4
# - uses: julia-actions/setup-julia@v2
# with:
# version: ${{ matrix.version }}
# - uses: julia-actions/julia-downgrade-compat@v1
# with:
# skip: Pkg,TOML
# - uses: julia-actions/julia-buildpkg@v1
# - uses: julia-actions/julia-runtest@v1
80 changes: 41 additions & 39 deletions .github/workflows/Downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,42 +27,44 @@ jobs:
- {user: SciML, repo: BoundaryValueDiffEq.jl, group: All}
- {user: SciML, repo: DiffEqCallbacks.jl, group: All}
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}
arch: x64
- uses: julia-actions/julia-buildpkg@latest
- name: Clone Downstream
uses: actions/checkout@v4
with:
repository: ${{ matrix.package.user }}/${{ matrix.package.repo }}
path: downstream
- name: Load this and run the downstream tests
shell: julia --color=yes --project=downstream {0}
run: |
using Pkg
try
# force it to use this PR's version of the package
Pkg.develop(PackageSpec(path=".")) # resolver may fail with main deps
Pkg.update()
Pkg.test(coverage=true) # resolver may fail with test time deps
catch err
err isa Pkg.Resolve.ResolverError || rethrow()
# If we can't resolve that means this is incompatible by SemVer and this is fine
# It means we marked this as a breaking change, so we don't need to worry about
# Mistakenly introducing a breaking change, as we have intentionally made one
@info "Not compatible with this release. No problem." exception=err
exit(0) # Exit immediately, as a success
end
env:
RETESTITEMS_NWORKERS: 4
RETESTITEMS_NWORKER_THREADS: 2
- uses: julia-actions/julia-processcoverage@v1
with:
directories: src,ext
- uses: codecov/codecov-action@v4
with:
file: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
- name: "Stub"
run: echo "Remember to uncomment the following steps!!!!!!!!"
# - uses: actions/checkout@v4
# - uses: julia-actions/setup-julia@v2
# with:
# version: ${{ matrix.julia-version }}
# arch: x64
# - uses: julia-actions/julia-buildpkg@latest
# - name: Clone Downstream
# uses: actions/checkout@v4
# with:
# repository: ${{ matrix.package.user }}/${{ matrix.package.repo }}
# path: downstream
# - name: Load this and run the downstream tests
# shell: julia --color=yes --project=downstream {0}
# run: |
# using Pkg
# try
# # force it to use this PR's version of the package
# Pkg.develop(PackageSpec(path=".")) # resolver may fail with main deps
# Pkg.update()
# Pkg.test(coverage=true) # resolver may fail with test time deps
# catch err
# err isa Pkg.Resolve.ResolverError || rethrow()
# # If we can't resolve that means this is incompatible by SemVer and this is fine
# # It means we marked this as a breaking change, so we don't need to worry about
# # Mistakenly introducing a breaking change, as we have intentionally made one
# @info "Not compatible with this release. No problem." exception=err
# exit(0) # Exit immediately, as a success
# end
# env:
# RETESTITEMS_NWORKERS: 4
# RETESTITEMS_NWORKER_THREADS: 2
# - uses: julia-actions/julia-processcoverage@v1
# with:
# directories: src,ext
# - uses: codecov/codecov-action@v4
# with:
# file: lcov.info
# token: ${{ secrets.CODECOV_TOKEN }}
# fail_ci_if_error: true

0 comments on commit 734b2f8

Please sign in to comment.