From 000acc6e73a1f3d06f35ae1fa0f63e40310211be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Fri, 13 Nov 2020 00:05:21 +0100 Subject: [PATCH] Switch CI to Github actions --- .github/workflows/CompatHelper.yml | 11 +++--- .github/workflows/TagBot.yml | 8 +++-- .github/workflows/ci.yml | 52 +++++++++++++++++++++++++++++ .github/workflows/documentation.yml | 23 +++++++++++++ .travis.yml | 36 -------------------- README.md | 14 +++----- 6 files changed, 93 insertions(+), 51 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/documentation.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml index dd821e6..0f66259 100644 --- a/.github/workflows/CompatHelper.yml +++ b/.github/workflows/CompatHelper.yml @@ -3,14 +3,17 @@ name: CompatHelper on: schedule: - cron: '00 00 * * *' + workflow_dispatch: jobs: CompatHelper: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + julia-version: [1.2.0] + julia-arch: [x86] + os: [ubuntu-latest] steps: - - uses: julia-actions/setup-julia@latest - with: - version: 1.3 - name: Pkg.add("CompatHelper") run: julia -e 'using Pkg; Pkg.add("CompatHelper")' - name: CompatHelper.main() diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml index d77d3a0..f49313b 100644 --- a/.github/workflows/TagBot.yml +++ b/.github/workflows/TagBot.yml @@ -1,11 +1,15 @@ name: TagBot on: - schedule: - - cron: 0 * * * * + issue_comment: + types: + - created + workflow_dispatch: jobs: TagBot: + if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' runs-on: ubuntu-latest steps: - uses: JuliaRegistries/TagBot@v1 with: token: ${{ secrets.GITHUB_TOKEN }} + ssh: ${{ secrets.DOCUMENTER_KEY }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..341ca3a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,52 @@ +name: CI +on: + push: + branches: [master] + pull_request: + types: [opened, synchronize, reopened] +jobs: + test: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + # Since MultivariatePolynomials doesn't have binary dependencies, + # only test on a subset of possible platforms. + include: + - version: '1' + os: ubuntu-latest + arch: x64 + - version: '1.0' + os: ubuntu-latest + arch: x64 + - version: '1' + os: ubuntu-latest + arch: x86 + - version: 'nightly' + 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 + with: + depwarn: error + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v1 + with: + file: lcov.info diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..624e6bf --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,23 @@ +name: Documentation +on: + push: + branches: [master] + tags: '*' + pull_request: + types: [opened, synchronize, reopened] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@latest + with: + # Build documentation on the latest Julia 1.x + version: '1' + - name: Install dependencies + run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' + - name: Build and deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key + run: julia --project=docs/ docs/make.jl diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 64c21a3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,36 +0,0 @@ -# Documentation: http://docs.travis-ci.com/user/languages/julia/ -language: julia -os: - - linux - - osx -julia: - - 1.0 - - 1.3 - - 1.4 - - nightly -notifications: - email: false - -matrix: - allow_failures: - - julia: nightly - -# Add GMP for GLPK -addons: - apt_packages: - - libgmp-dev -after_success: - # push coverage results to Coveralls - - julia -e 'cd(Pkg.dir("CutPruners")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())' - # push coverage results to Codecov - - julia -e 'cd(Pkg.dir("CutPruners")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())' - -jobs: - include: - - stage: "Documentation" - julia: 1.0 - os: linux - script: - - julia --project=docs -e 'using Pkg; Pkg.instantiate(); Pkg.add(PackageSpec(path=pwd()))' - - julia --project=docs --color=yes docs/make.jl - after_success: skip diff --git a/README.md b/README.md index 6ebd540..d1a9d40 100644 --- a/README.md +++ b/README.md @@ -2,21 +2,17 @@ | **Documentation** | **Build Status** | **Social** | |:-----------------:|:----------------:|:----------:| -| [![][docs-stable-img]][docs-stable-url] | [![Build Status][build-img]][build-url] [![Build Status][winbuild-img]][winbuild-url] | [![Gitter][gitter-img]][gitter-url] | -| [![][docs-latest-img]][docs-latest-url] | [![Coveralls branch][coveralls-img]][coveralls-url] [![Codecov branch][codecov-img]][codecov-url] | [][discourse-url] | +| [![][docs-stable-img]][docs-stable-url] | [![Build Status][build-img]][build-url] | [![Gitter][gitter-img]][gitter-url] | +| [![][docs-latest-img]][docs-latest-url] | [![Codecov branch][codecov-img]][codecov-url] | [][discourse-url] | [docs-stable-img]: https://img.shields.io/badge/docs-stable-blue.svg [docs-latest-img]: https://img.shields.io/badge/docs-latest-blue.svg [docs-stable-url]: https://JuliaPolyhedra.github.io/CutPruners.jl/stable -[docs-latest-url]: https://JuliaPolyhedra.github.io/CutPruners.jl/latest +[docs-latest-url]: https://JuliaPolyhedra.github.io/CutPruners.jl/dev -[build-img]: https://travis-ci.org/JuliaPolyhedra/CutPruners.jl.svg?branch=master -[build-url]: https://travis-ci.org/JuliaPolyhedra/CutPruners.jl -[winbuild-img]: https://ci.appveyor.com/api/projects/status/497mymfaaophscsg?svg=true -[winbuild-url]: https://ci.appveyor.com/project/JuliaPolyhedra/cutpruners-jl -[coveralls-img]: https://coveralls.io/repos/github/JuliaPolyhedra/CutPruners.jl/badge.svg -[coveralls-url]: https://coveralls.io/github/JuliaPolyhedra/CutPruners.jl +[build-img]: https://github.com/JuliaPolyhedra/CutPruners.jl/workflows/CI/badge.svg?branch=master +[build-url]: https://github.com/JuliaPolyhedra/CutPruners.jl/actions?query=workflow%3ACI [codecov-img]: https://codecov.io/gh/JuliaPolyhedra/CutPruners.jl/branch/master/graph/badge.svg [codecov-url]: https://codecov.io/gh/JuliaPolyhedra/CutPruners.jl [gitter-url]: https://gitter.im/JuliaOpt/StochasticDualDynamicProgramming.jl