Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch CI to github actions and remove Travis #199

Merged
merged 11 commits into from
Dec 2, 2020
47 changes: 47 additions & 0 deletions .github/workflows/ci-future.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI-future
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, what's the advantage of using a separate workflow for nightlies?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to keep that sweet sweet green badge even when things go sideways on nighly

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good idea. We could do that in DataFrames too, and in the PR I opened against Example.jl.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, less cheekily, to be able to see at a glance if any of the stable releases have failing tests AND whether nightly has failing tests, since those indicate different types of problems (only the first should block merging IMO, but we can't afford to ignore the second so we don't want to use continue-on-error and nighly failures green...).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I learned this trick from the MixedModels CI which has been on actions for a while now...

on:
pull_request:
branches:
- master
push:
branches:
- master
tags: '*'
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
env:
JULIA_NUM_THREADS: 2
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- 'nightly'
os:
- ubuntu-latest
arch:
- x64
steps:
- run: git config --global core.autocrlf false
- 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
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI
on:
pull_request:
branches:
- master
push:
branches:
- master
tags: '*'
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
env:
JULIA_NUM_THREADS: 2
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.0'
- '1' # automatically expands to the latest stable 1.x release of Julia
os:
- ubuntu-latest
arch:
- x64
kleinschmidt marked this conversation as resolved.
Show resolved Hide resolved
include:
- os: ubuntu-latest
arch: 'x86'
version: '1'
steps:
- run: git config --global core.autocrlf false
- 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
25 changes: 8 additions & 17 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,14 @@ on:
- 'master'
tags: '*'
pull_request:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1.3.0]
julia-arch: [x86]
os: [ubuntu-latest]
Documenter:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1.0.0
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
- uses: actions/checkout@v2
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-docdeploy@latest
env:
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
run: julia --project=docs/ docs/make.jl
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# StatsModels

[![Build Status](https://travis-ci.com/JuliaStats/StatsModels.jl.svg?branch=master)](https://travis-ci.com/JuliaStats/StatsModels.jl)
[![Build Status](https://github.com/JuliaStats/StatsModels.jl/workflows/CI/badge.svg)](https://github.com/JuliaStats/StatsModels.jl/actions?query=workflow%3ACI+branch%3Amaster)
[![codecov](https://codecov.io/gh/JuliaStats/StatsModels.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaStats/StatsModels.jl)

Basic functionality for specifying, fitting, and evaluating statistical models
Expand Down
30 changes: 21 additions & 9 deletions test/statsmodel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,25 @@ end
lrtest(m0, m1))
@test isnan(lr2.pval[1])
@test lr2.pval[2] ≈ 1.2147224767092312e-5
@test sprint(show, lr2) == """
Likelihood-ratio test: 2 models fitted on 4 observations
──────────────────────────────────────────────
DOF ΔDOF Deviance ΔDeviance p(>Chisq)
──────────────────────────────────────────────
[1] 0 30.0000
[2] 1 1 10.8600 -19.1400 <1e-4
──────────────────────────────────────────────"""

end
# in 1.6, p value printing has changed (JuliaStats/StatsBase.jl#606)
if VERSION > v"1.6.0-DEV"
@test sprint(show, lr2) == """
Likelihood-ratio test: 2 models fitted on 4 observations
──────────────────────────────────────────────
DOF ΔDOF Deviance ΔDeviance p(>Chisq)
──────────────────────────────────────────────
[1] 0 30.0000
[2] 1 1 10.8600 -19.1400 <1e-04
──────────────────────────────────────────────"""
else
@test sprint(show, lr2) == """
Likelihood-ratio test: 2 models fitted on 4 observations
──────────────────────────────────────────────
DOF ΔDOF Deviance ΔDeviance p(>Chisq)
──────────────────────────────────────────────
[1] 0 30.0000
[2] 1 1 10.8600 -19.1400 <1e-4
──────────────────────────────────────────────"""
end
end