diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..a9a63ff --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,46 @@ +name: CI +on: + pull_request: + push: + branches: + - main + tags: '*' +jobs: + test: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: + - '1.3' + - '1.6' +# - 'nightly' + os: + - ubuntu-latest +# - macOS-latest +# - windows-latest + arch: + - x64 + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - uses: actions/cache@v1 + 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 + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v1 + with: + file: lcov.info diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml new file mode 100644 index 0000000..d77d3a0 --- /dev/null +++ b/.github/workflows/TagBot.yml @@ -0,0 +1,11 @@ +name: TagBot +on: + schedule: + - cron: 0 * * * * +jobs: + TagBot: + runs-on: ubuntu-latest + steps: + - uses: JuliaRegistries/TagBot@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/src/regression.jl b/src/regression.jl index 938bf43..7db4371 100644 --- a/src/regression.jl +++ b/src/regression.jl @@ -9,7 +9,7 @@ function chebregression(x::AbstractVector{SVector{N,Td}}, y::AbstractVector{T}, # assemble rhs as matrix Y = Array{float(eltype(T))}(undef, length(y), length(first(y))) for j = 1:length(y) - Y[j,:] .= y[j + (begin-1)] + Y[j,:] .= y[j + (firstindex(y)-1)] end # assemble lhs matrix @@ -22,7 +22,7 @@ function chebregression(x::AbstractVector{SVector{N,Td}}, y::AbstractVector{T}, for i = 1:length(c.coefs) c.coefs[i] = 1 # basis function for j = 1:length(x) - A[j,i] = c(x[j + (begin-1)]) + A[j,i] = c(x[j + (firstindex(x)-1)]) end c.coefs[i] = 0 # reset end