Skip to content

Commit 02b2aa8

Browse files
Merge pull request #48 from SpM-lab/terasaki/Introduce-CI
Add workflow file
2 parents 85f93e4 + 35e5889 commit 02b2aa8

File tree

3 files changed

+62
-1
lines changed

3 files changed

+62
-1
lines changed

.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: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
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+
# needed to allow julia-actions/cache to delete old caches that it has created
15+
permissions:
16+
actions: write
17+
contents: read
18+
jobs:
19+
test:
20+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
21+
runs-on: ${{ matrix.os }}
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
version:
26+
- 'lts'
27+
- '1'
28+
os:
29+
- ubuntu-latest
30+
#- macOS-latest
31+
#- windows-latest
32+
arch:
33+
- x64
34+
steps:
35+
- name: Clone libsparseir
36+
run: |
37+
git clone https://github.com/SpM-lab/libsparseir.git --depth 1 ../libsparseir
38+
cd ../libsparseir
39+
bash build_capi.sh
40+
- uses: actions/checkout@v4
41+
- uses: julia-actions/setup-julia@v2
42+
with:
43+
version: ${{ matrix.version }}
44+
arch: ${{ matrix.arch }}
45+
- uses: julia-actions/cache@v2
46+
- uses: julia-actions/julia-buildpkg@v1
47+
- uses: julia-actions/julia-runtest@v1
48+
continue-on-error: ${{ matrix.version == 'nightly' }}
49+
- uses: julia-actions/julia-processcoverage@v1
50+
- uses: codecov/codecov-action@v3

deps/build.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,8 @@ ctx = create_context(headers, args, options)
2525
# run generator
2626
build!(ctx)
2727

28-
run(`sed -i '' 's/const c_complex = ComplexF32/const c_complex = ComplexF64/g' $(joinpath(@__DIR__, "../src/C_API.jl"))`)
28+
# Replace line 28 with:
29+
file_path = joinpath(@__DIR__, "../src/C_API.jl")
30+
content = read(file_path, String)
31+
content = replace(content, "const c_complex = ComplexF32" => "const c_complex = ComplexF64")
32+
write(file_path, content)

0 commit comments

Comments
 (0)