diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ecf6175 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +name: CI +on: + pull_request: + branches: + - master + - dev + push: + branches: + - master + - dev + 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' + os: + - ubuntu-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/.travis.yml b/.travis.yml deleted file mode 100644 index 10913fc..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -# Documentation: http://docs.travis-ci.com/user/languages/julia/ -language: julia -os: - - linux -julia: -# - 1.0 - - 1.5 - - nightly -matrix: - allow_failures: - - julia: nightly -notifications: - email: false -after_success: - # push coverage results to Codecov - - julia -e 'using Pkg; pkg"add Coverage"; using Coverage; Codecov.submit(Codecov.process_folder())' diff --git a/README.md b/README.md index c653b4a..cff3512 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,6 @@ Repository implementing MLJ interface for [XGBoost](https://github.com/JuliaStats/XGBoost.jl) models. -[![Build Status](https://travis-ci.com/alan-turing-institute/MLJXGBoostInterface.jl.svg?branch=master)](https://travis-ci.com/github/alan-turing-institute/MLJXGBoostInterface.jl) +[![Build Status](https://github.com/alan-turing-institute/MLJXGBoostInterface.jl/workflows/CI/badge.svg)](https://github.com/alan-turing-institute/MLJXGBoostInterface.jl/actions) [![Coverage](http://codecov.io/github/alan-turing-institute/MLJXGBoostInterface.jl/coverage.svg?branch=master)](https://codecov.io/gh/alan-turing-institute/MLJXGBoostInterface.jl) [![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle) diff --git a/test/runtests.jl b/test/runtests.jl index 8bd0eaa..6962070 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -95,7 +95,7 @@ misclassification_rate = sum(yhat .!= y[test])/length(test) # check target pool preserved: X = (x1=rand(rng, 400), x2=rand(rng, 400), x3=rand(rng, 400)) -ycat = vcat(fill(:x, 100), fill(:y, 100), fill(:z, 200)) |>categorical +ycat = vcat(fill('x', 100), fill('y', 100), fill('z', 200)) |>categorical y = identity.(ycat) train, test = partition(eachindex(y), 0.5) @test length(unique(y[train])) == 2