Skip to content

Commit bc511dd

Browse files
committed
Add CI and improve tests.
1 parent 0926739 commit bc511dd

File tree

7 files changed

+270
-100
lines changed

7 files changed

+270
-100
lines changed

.JuliaFormatter.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Configuration file for JuliaFormatter.jl
2+
# For more information, see: https://domluna.github.io/JuliaFormatter.jl/stable/config/
3+
4+
always_for_in = true
5+
always_use_return = true
6+
margin = 80
7+
remove_extra_newlines = true
8+
separate_kwargs_with_semicolon = true
9+
short_to_long_function_def = true

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
# needed to allow julia-actions/cache to delete old caches that it has created
9+
permissions:
10+
actions: write
11+
contents: read
12+
jobs:
13+
test:
14+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- version: '1' # The latest point-release (Linux)
21+
os: ubuntu-latest
22+
arch: x64
23+
- version: '1' # The latest point-release (Windows)
24+
os: windows-latest
25+
arch: x64
26+
- version: '1.10' # 1.6 LTS (64-bit Linux)
27+
os: ubuntu-latest
28+
arch: x64
29+
- version: '1.10' # 1.6 LTS (32-bit Linux)
30+
os: ubuntu-latest
31+
arch: x86
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: julia-actions/setup-julia@v2
35+
with:
36+
version: ${{ matrix.version }}
37+
arch: ${{ matrix.arch }}
38+
- uses: julia-actions/cache@v1
39+
- uses: julia-actions/julia-buildpkg@v1
40+
- uses: julia-actions/julia-runtest@v1
41+
with:
42+
depwarn: error
43+
- uses: julia-actions/julia-processcoverage@v1
44+
- uses: codecov/codecov-action@v4
45+
with:
46+
file: lcov.info
47+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/format_check.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: format-check
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: julia-actions/setup-julia@latest
13+
with:
14+
version: '1'
15+
- uses: actions/checkout@v4
16+
- name: Format check
17+
shell: julia --color=yes {0}
18+
run: |
19+
using Pkg
20+
Pkg.add(PackageSpec(name="JuliaFormatter", version="2"))
21+
using JuliaFormatter
22+
format("."; verbose = true)
23+
out = String(read(Cmd(`git diff`)))
24+
if isempty(out)
25+
exit(0)
26+
end
27+
@error "Some files have not been formatted !!!"
28+
write(stdout, out)
29+
exit(1)

Project.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1313
[compat]
1414
CliqueTrees = "1.5.1"
1515
Graphs = "1.12.1"
16-
LinearAlgebra = "1.11.0"
17-
MathOptInterface = "1.39.0"
18-
SparseArrays = "1.11.0"
16+
LinearAlgebra = "1.10"
17+
MathOptInterface = "1.39"
18+
SparseArrays = "1.10"
19+
julia = "1.10"

0 commit comments

Comments
 (0)