Skip to content
This repository was archived by the owner on Sep 28, 2024. It is now read-only.

Commit 08b555a

Browse files
committed
Improve code standards
1 parent 0bf7fda commit 08b555a

26 files changed

+683
-411
lines changed

.JuliaFormatter.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
style = "sciml"
22
format_markdown = true
33
whitespace_in_kwargs = false
4-
always_use_return = true
54
margin = 92
65
indent = 4
76
format_docstrings = true
87
separate_kwargs_with_semicolon = true
98
always_for_in = true
109
annotate_untyped_fields_with_any = false
10+
join_lines_based_on_source = false

.buildkite/pipeline.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
steps:
2+
- label: ":julia: Julia {{matrix.julia}} + CUDA GPU"
3+
plugins:
4+
- JuliaCI/julia#v1:
5+
version: "{{matrix.julia}}"
6+
- JuliaCI/julia-test#v1:
7+
test_args: "--quickfail"
8+
- JuliaCI/julia-coverage#v1:
9+
codecov: true
10+
dirs:
11+
- src
12+
- ext
13+
agents:
14+
queue: "juliagpu"
15+
cuda: "*"
16+
env:
17+
BACKEND_GROUP: "CUDA"
18+
if: build.message !~ /\[skip tests\]/
19+
timeout_in_minutes: 240
20+
matrix:
21+
setup:
22+
julia:
23+
- "1"
24+
25+
- label: ":julia: Julia: {{matrix.julia}} + AMD GPU"
26+
plugins:
27+
- JuliaCI/julia#v1:
28+
version: "{{matrix.julia}}"
29+
- JuliaCI/julia-test#v1:
30+
test_args: "--quickfail"
31+
- JuliaCI/julia-coverage#v1:
32+
codecov: true
33+
dirs:
34+
- src
35+
- ext
36+
env:
37+
JULIA_AMDGPU_CORE_MUST_LOAD: "1"
38+
JULIA_AMDGPU_HIP_MUST_LOAD: "1"
39+
JULIA_AMDGPU_DISABLE_ARTIFACTS: "1"
40+
BACKEND_GROUP: "AMDGPU"
41+
agents:
42+
queue: "juliagpu"
43+
rocm: "*"
44+
rocmgpu: "*"
45+
if: build.message !~ /\[skip tests\]/
46+
timeout_in_minutes: 240
47+
matrix:
48+
setup:
49+
julia:
50+
- "1"
51+
52+
env:
53+
RETESTITEMS_NWORKERS: 4
54+
RETESTITEMS_NWORKER_THREADS: 2
55+
SECRET_CODECOV_TOKEN: "TEJEkJA4PvPGNMb6mOizb4+U1eYmEHYk7ojQxLYDQJaarX79BsNs0cmWDOWGj7HkEVYVuQENfUBLqHfv/ih2991s8HS4jHX9zcZhUYXVarWC6Zr+hB8iMReiT7zfoZq7lEocUegTzVEoOstqfFusALwUHibpWHMpaG8SzHD0ii7N53uWyh6HJeQO6mfwusdtgr5oxGgDwYwb1E+iBGGj5AP6z7m+BrXgRbiKaAgoHADYd9AJzhN52S37lkwWMH9RMujFtojyCojIo7f9I5zYoqBKG44uy/IQEoEysf8qQ3WHSBZ/2i+/ircPY4xwVjqS1XZCTbUJ2uHuR+uEETJ9rw==;U2FsdGVkX19yYNkBa1palRpYrA2OylGMaUoLA/TowOS0D2+zxpNW97mOA5vfl13VZSmkQiRElPQEukKTrsFQyA=="

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/" # Location of package manifests
6+
schedule:
7+
interval: "weekly"

.github/workflows/CI.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
push:
7+
branches:
8+
- main
9+
concurrency:
10+
# Skip intermediate builds: always.
11+
# Cancel intermediate builds: only if it is a pull request build.
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
version:
21+
- "1"
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: julia-actions/setup-julia@v2
25+
with:
26+
version: ${{ matrix.version }}
27+
- uses: actions/cache@v4
28+
env:
29+
cache-name: cache-artifacts
30+
with:
31+
path: ~/.julia/artifacts
32+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
33+
restore-keys: |
34+
${{ runner.os }}-test-${{ env.cache-name }}-
35+
${{ runner.os }}-test-
36+
${{ runner.os }}-
37+
- uses: julia-actions/julia-buildpkg@v1
38+
- uses: julia-actions/julia-runtest@v1
39+
env:
40+
BACKEND_GROUP: "CPU"
41+
RETESTITEMS_NWORKERS: 4
42+
RETESTITEMS_NWORKER_THREADS: 2
43+
- uses: julia-actions/julia-processcoverage@v1
44+
with:
45+
directories: src,ext
46+
- uses: codecov/codecov-action@v4
47+
with:
48+
files: lcov.info
49+
token: ${{ secrets.CODECOV_TOKEN }}
50+
verbose: true
51+
fail_ci_if_error: true

.github/workflows/CompatHelper.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CompatHelper
2+
on:
3+
schedule:
4+
- cron: 0 0 * * *
5+
workflow_dispatch:
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
jobs:
10+
CompatHelper:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check if Julia is already available in the PATH
14+
id: julia_in_path
15+
run: which julia
16+
continue-on-error: true
17+
- name: Install Julia, but only if it is not already available in the PATH
18+
uses: julia-actions/setup-julia@v2
19+
with:
20+
version: '1'
21+
arch: ${{ runner.arch }}
22+
if: steps.julia_in_path.outcome != 'success'
23+
- name: "Add the General registry via Git"
24+
run: |
25+
import Pkg
26+
ENV["JULIA_PKG_SERVER"] = ""
27+
Pkg.Registry.add("General")
28+
shell: julia --color=yes {0}
29+
- name: "Install CompatHelper"
30+
run: |
31+
import Pkg
32+
name = "CompatHelper"
33+
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
34+
version = "3"
35+
Pkg.add(; name, uuid, version)
36+
shell: julia --color=yes {0}
37+
- name: "Run CompatHelper"
38+
run: |
39+
import CompatHelper
40+
CompatHelper.main()
41+
shell: julia --color=yes {0}
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/Downgrade.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Downgrade
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
paths-ignore:
7+
- 'docs/**'
8+
push:
9+
branches:
10+
- master
11+
paths-ignore:
12+
- 'docs/**'
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
version: ['1']
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: julia-actions/setup-julia@v2
22+
with:
23+
version: ${{ matrix.version }}
24+
- uses: cjdoris/julia-downgrade-compat-action@v1
25+
with:
26+
skip: Pkg,TOML,Statistics,Random,Artifacts,LazyArtifacts
27+
- uses: julia-actions/julia-buildpkg@v1
28+
- uses: julia-actions/julia-runtest@v1
29+
env:
30+
BACKEND_GROUP: "CPU"
31+
RETESTITEMS_NWORKERS: 4
32+
RETESTITEMS_NWORKER_THREADS: 2
33+
- uses: julia-actions/julia-processcoverage@v1
34+
with:
35+
directories: src,ext
36+
- uses: codecov/codecov-action@v4
37+
with:
38+
files: lcov.info
39+
token: ${{ secrets.CODECOV_TOKEN }}
40+
verbose: true
41+
fail_ci_if_error: true

.github/workflows/FormatCheck.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Format suggestions
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
code-style:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: julia-actions/julia-format@v3

.github/workflows/FormatPR.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: FormatPR
2+
on:
3+
schedule:
4+
- cron: '0 0 * * *'
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Install JuliaFormatter and format
11+
run: |
12+
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
13+
julia -e 'using JuliaFormatter; format(".")'
14+
# https://github.com/marketplace/actions/create-pull-request
15+
# https://github.com/peter-evans/create-pull-request#reference-example
16+
- name: Create Pull Request
17+
id: cpr
18+
uses: peter-evans/create-pull-request@v6
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
commit-message: Format .jl files
22+
title: 'Automatic JuliaFormatter.jl run'
23+
branch: auto-juliaformatter-pr
24+
delete-branch: true
25+
labels: formatting, automated pr, no changelog
26+
- name: Check outputs
27+
run: |
28+
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
29+
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Invalidations
2+
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
# Skip intermediate builds: always.
8+
# Cancel intermediate builds: always.
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
evaluate:
14+
# Only run on PRs to the default branch.
15+
# In the PR trigger above branches can be specified only explicitly whereas this check should work for master, main, or any other default branch
16+
if: github.base_ref == github.event.repository.default_branch
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: julia-actions/setup-julia@v2
20+
with:
21+
version: "1"
22+
- uses: actions/checkout@v4
23+
- uses: julia-actions/julia-buildpkg@v1
24+
- uses: julia-actions/julia-invalidations@v1
25+
id: invs_pr
26+
27+
- uses: actions/checkout@v4
28+
with:
29+
ref: ${{ github.event.repository.default_branch }}
30+
- uses: julia-actions/julia-buildpkg@v1
31+
- uses: julia-actions/julia-invalidations@v1
32+
id: invs_default
33+
34+
- name: Report invalidation counts
35+
run: |
36+
echo "Invalidations on default branch: ${{ steps.invs_default.outputs.total }} (${{ steps.invs_default.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY
37+
echo "This branch: ${{ steps.invs_pr.outputs.total }} (${{ steps.invs_pr.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY
38+
- name: Check if the PR does increase number of invalidations
39+
if: steps.invs_pr.outputs.total > steps.invs_default.outputs.total
40+
run: exit 1

.github/workflows/TagBot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: TagBot
2+
on:
3+
issue_comment:
4+
types:
5+
- created
6+
workflow_dispatch:
7+
jobs:
8+
TagBot:
9+
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: JuliaRegistries/TagBot@v1
13+
with:
14+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)