Skip to content

Commit

Permalink
Switch CI to GitHub actions (#316)
Browse files Browse the repository at this point in the history
* Switch CI to GitHub actions
* Update .github/workflows/CI.yml

Co-authored-by: mattBrzezinski <matt.brzezinski@invenia.ca>
  • Loading branch information
omus and mattBrzezinski authored Dec 9, 2020
1 parent 01d025a commit a314759
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 105 deletions.
135 changes: 135 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: CI
# Run on master, tags, or any pull request
on:
pull_request:
branches: "*"
push:
branches: master
tags: "*"
schedule:
- cron: "0 2 * * *" # Daily at 2 AM UTC (8 PM CST)
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
version:
- "1.0" # LTS
- "1" # Latest release
- nightly
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
- x86
exclude:
# Test 32-bit only on Linux
- os: macOS-latest
arch: x86
- os: windows-latest
arch: x86
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 }}-
# Only download the tzdata version used in TimeZones.jl's tests to avoid unnecessary
# load on IANA's servers. However, if the DEFAULT_TZDATA_VERSION constant was
# changed we need to also build the version specified by the constant to ensure it can be
# compiled.
# Note: The `git diff` command has a `--quiet` flag that will suppress output but doesn't
# catch all changes.
#
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
- run: |
git fetch origin +:refs/remotes/origin/HEAD
if git diff --exit-code -G"^const DEFAULT_TZDATA_VERSION" origin/HEAD..HEAD > /dev/null; then
echo "JULIA_TZ_VERSION=$TZDATA_VERSION" >> $GITHUB_ENV
fi
shell: bash
env:
TZDATA_VERSION: 2016j # Matches tzdata version used in tests
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info

benchmarks:
name: Benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: "1"
- uses: julia-actions/julia-buildpkg@latest
- run: |
git fetch origin +:refs/remotes/origin/HEAD
julia --project=benchmark/ -e 'using Pkg; Pkg.instantiate(); Pkg.develop(PackageSpec(path=pwd()))'
julia --project=benchmark/ -e 'using PkgBenchmark, TimeZones; export_markdown(stdout, judge(TimeZones, "origin/HEAD", verbose=false))'
doctest:
name: Documentation - Julia ${{ matrix.version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
version:
- "1.0"
- 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: julia-actions/julia-buildpkg@latest
- run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- run: julia --project=docs docs/make.jl

# TODO: Previously on Travis CI was conditional on running on `master` or a tag:
# `if: (branch = master AND type != pull_request) OR tag =~ ^v`
docs:
name: Documentation Deploy
runs-on: ubuntu-latest
needs: doctest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: "1"
- uses: julia-actions/julia-buildpkg@latest
- run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- run: julia --project=docs docs/deploy.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
104 changes: 0 additions & 104 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,7 +1,7 @@
TimeZones.jl
============

[![Travis CI](https://travis-ci.com/JuliaTime/TimeZones.jl.svg?branch=master)](https://travis-ci.com/JuliaTime/TimeZones.jl)
[![CI](https://github.com/JuliaTime/TimeZones.jl/workflows/CI/badge.svg)](https://github.com/JuliaTime/TimeZones.jl/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/JuliaTime/TimeZones.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaTime/TimeZones.jl)
<br/>
[![Stable Documentation](https://img.shields.io/badge/docs-stable-blue.svg)](https://juliatime.github.io/TimeZones.jl/stable)
Expand Down

0 comments on commit a314759

Please sign in to comment.