Skip to content

Commit

Permalink
Simpler subfolder CI
Browse files Browse the repository at this point in the history
  • Loading branch information
luraess committed Oct 31, 2023
1 parent db7cc39 commit 746d1ab
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 60 deletions.
19 changes: 4 additions & 15 deletions scripts/l7_project_template/CI.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@
name: CI
on:
[push, pull_request]
name: Run tests
on: [push, pull_request]
jobs:
test:
name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }} - ${{ matrix.julia-arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
julia-version: ['1.9']
julia-arch: [x64]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}
- uses: actions/cache@v3
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: julia-actions/julia-buildpkg@latest
- run: julia --color=yes -e 'cd("PorousConvection");
import Pkg; Pkg.activate("."); Pkg.test()'
19 changes: 4 additions & 15 deletions slide-notebooks/l7_2-tests-ci.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,35 +135,24 @@ md"""
This makes the `.yml` a bit more complicated:
```yml
name: CI
on:
[push, pull_request]
name: Run tests
on: [push, pull_request]
jobs:
test:
name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }} - ${{ matrix.julia-arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
julia-version: ['1.9']
julia-arch: [x64]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}
- uses: actions/cache@v3
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: julia-actions/julia-buildpkg@latest
- run: julia --color=yes -e 'cd("<subfolder-of-julia-project>");
import Pkg; Pkg.activate("."); Pkg.test()'
Expand Down
19 changes: 4 additions & 15 deletions slide-notebooks/notebooks/l7_2-tests-ci.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -205,35 +205,24 @@
"\n",
"This makes the `.yml` a bit more complicated:\n",
"```yml\n",
"name: CI\n",
"on:\n",
" [push, pull_request]\n",
"name: Run tests\n",
"on: [push, pull_request]\n",
"jobs:\n",
" test:\n",
" name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }} - ${{ matrix.julia-arch }} - ${{ github.event_name }}\n",
" runs-on: ${{ matrix.os }}\n",
" strategy:\n",
" fail-fast: false\n",
" matrix:\n",
" julia-version: ['1.9']\n",
" julia-arch: [x64]\n",
" os: [ubuntu-latest]\n",
"\n",
" steps:\n",
" - uses: actions/checkout@v4\n",
" - uses: julia-actions/setup-julia@v1\n",
" with:\n",
" version: ${{ matrix.julia-version }}\n",
" arch: ${{ matrix.julia-arch }}\n",
" - uses: actions/cache@v3\n",
" env:\n",
" cache-name: cache-artifacts\n",
" with:\n",
" path: ~/.julia/artifacts\n",
" key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}\n",
" restore-keys: |\n",
" ${{ runner.os }}-test-${{ env.cache-name }}-\n",
" ${{ runner.os }}-test-\n",
" ${{ runner.os }}-\n",
" - uses: julia-actions/cache@v1\n",
" - uses: julia-actions/julia-buildpkg@latest\n",
" - run: julia --color=yes -e 'cd(\"<subfolder-of-julia-project>\");\n",
" import Pkg; Pkg.activate(\".\"); Pkg.test()'\n",
Expand Down
19 changes: 4 additions & 15 deletions website/_literate/l7_2-tests-ci_web.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,35 +135,24 @@ md"""
This makes the `.yml` a bit more complicated:
```yml
name: CI
on:
[push, pull_request]
name: Run tests
on: [push, pull_request]
jobs:
test:
name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }} - ${{ matrix.julia-arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
julia-version: ['1.9']
julia-arch: [x64]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}
- uses: actions/cache@v3
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: julia-actions/julia-buildpkg@latest
- run: julia --color=yes -e 'cd("<subfolder-of-julia-project>");
import Pkg; Pkg.activate("."); Pkg.test()'
Expand Down

0 comments on commit 746d1ab

Please sign in to comment.