Skip to content

Commit

Permalink
Replace Azure with Github Actions and disable Travis:
Browse files Browse the repository at this point in the history
* Travis become a burden for OSS

* Attempt to fix coveralls and git-modtime script

* Add special versioning variable for cache. Introduce separate cache for windows

* Use new shc that supports Github Actions

* Off windows ghc-8.8 and 8.10

* Using system ghc

* Make bash default. Fix coveralls
  • Loading branch information
lehins committed Jan 21, 2021
1 parent 0912737 commit c970293
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 261 deletions.
129 changes: 0 additions & 129 deletions .azure/job.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .azure/pipelines.yml

This file was deleted.

99 changes: 80 additions & 19 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,96 @@
name: Haskell CI
name: Color-CI

on:
push:
branches: [ master ]
branches: [ '*' ]
pull_request:
branches: [ master ]

defaults: { run: { shell: bash } }

jobs:
build:
name: CI
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
resolver: [nightly, lts-16, lts-14, lts-12]
include:
- resolver: lts-12
ghc: 8.4.4
stack-yaml: stack-extra-deps.yaml
- resolver: lts-14
stack-yaml: stack-coveralls.yaml
- resolver: lts-16
ghc: 8.8.4

runs-on: ubuntu-latest
# Latest stable for MacOS: ghc-8.8.4
- resolver: lts-16
os: macos-latest
# Latest stable for Windows: ghc-8.6.4
- resolver: lts-14
os: windows-latest

env:
STACK_YAML: stack.yaml
STACK_ARGS: '--resolver ${{ matrix.resolver }}'
cache-version: v2 # bump up this version to invalidate currently stored cache
steps:
- uses: actions/checkout@v2

# - name: Cache
# uses: actions/cache@v1
# env:
# resolver: lts-16
# with:
# path: ~/.stack
# key: ${{ runner.os }}-build-${{ env.resolver }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.resolver }}
# ${{ runner.os }}-build-
# ${{ runner.os }}-
- name: Cache
id: cache
uses: actions/cache@v2
with:
path: |
~/.stack
Color/.stack-work
key: ${{ runner.os }}-${{ matrix.resolver }}-${{ env.cache-version }}
restore-keys: |
${{ runner.os }}-${{ matrix.resolver }}-${{ env.cache-version }}
- name: Workaround setup-exe-cache failure on macos
if: steps.cache.outputs.cache-hit == 'true' && matrix.os == 'macos-latest'
run: |
rm -r ~/.stack/setup-exe-cache
- name: Windows Cache
id: cache-windows
uses: actions/cache@v2
if: matrix.os == 'windows-latest'
with:
path: |
~/AppData/Local/Programs/stack
key: ${{ runner.os }}-${{ matrix.resolver }}-programs-${{ env.cache-version }}
restore-keys: |
${{ runner.os }}-${{ matrix.resolver }}-programs-${{ env.cache-version }}
- name: Install dependencies
- name: Ubuntu install GHC
if: matrix.ghc != '' && matrix.os == 'ubuntu-latest'
run: |
sudo add-apt-repository ppa:hvr/ghc -y
sudo apt-get update
sudo apt-get install ghc-${{ matrix.ghc }}
- name: Install Stack and local GHC
run: |
set -ex
curl -sSL https://get.haskellstack.org/ | sh -s - -f
curl -sSL https://gist.githubusercontent.com/lehins/fd36a8cc8bf853173437b17f6b6426ad/raw/d9ddb32cac2f0dc6800be4fa54d450f0dcda6c60/git-modtime.hs -o git-modtime.hs
stack script --resolver lts-16 git-modtime.hs
- name: Test
run: stack --resolver lts-16 test --bench --no-run-benchmarks --haddock --no-haddock-deps
curl -sSL https://gist.githubusercontent.com/lehins/fd36a8cc8bf853173437b17f6b6426ad/raw/4702d0252731ad8b21317375e917124c590819ce/git-modtime.hs -o git-modtime.hs
[ -n "${{ matrix.ghc }}" ] && [ "${{ matrix.os }}" == "ubuntu-latest" ] && STACK_ARGS="$STACK_ARGS --system-ghc"
[ -n "${{ matrix.stack-yaml }}" ] && STACK_YAML=${{ matrix.stack-yaml }}
stack $STACK_ARGS runghc git-modtime.hs
- name: Tests
env:
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: |
set -ex
[ -n "${{ matrix.ghc }}" ] && [ "${{ matrix.os }}" == "ubuntu-latest" ] && STACK_ARGS="$STACK_ARGS --system-ghc"
[ -n "${{ matrix.stack-yaml }}" ] && STACK_YAML=${{ matrix.stack-yaml }}
if [ "${{ matrix.os }}.${{ matrix.resolver }}" == "ubuntu-latest.lts-14" ] && [ -n "${COVERALLS_TOKEN}" ]; then
stack $STACK_ARGS test Color:tests --coverage --haddock --no-haddock-deps
stack $STACK_ARGS hpc report --all
curl -L https://github.com/lehins/stack-hpc-coveralls/releases/download/v0.0.6.0/shc.tar.gz | tar xz shc
./shc --repo-token="$COVERALLS_TOKEN" --partial-coverage --fetch-coverage combined custom
else
stack $STACK_ARGS test Color:tests Color:doctests --bench --no-run-benchmarks --haddock --no-haddock-deps
fi
74 changes: 0 additions & 74 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions Color/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ conversion, chromatic adaptation and other color manipulations.

## Status

| Language | Travis | Azure | Coveralls |Gitter.im |
|:--------:|:------:|:--------:|:---------:|:--------:|
| ![GitHub top language](https://img.shields.io/github/languages/top/lehins/Color.svg) | [![Travis](https://img.shields.io/travis/lehins/Color/master.svg?label=Linux%20%26%20OS%20X)](https://travis-ci.org/lehins/Color) | [![Build Status](https://dev.azure.com/kuleshevich/Color/_apis/build/status/lehins.Color?branchName=master)](https://dev.azure.com/kuleshevich/Color/_build?branchName=master) | [![Coverage Status](https://coveralls.io/repos/github/lehins/Color/badge.svg?branch=master)](https://coveralls.io/github/lehins/Color?branch=master) | [![Join the chat at https://gitter.im/haskell-massiv/Lobby](https://badges.gitter.im/haskell-massiv/Lobby.svg)](https://gitter.im/haskell-massiv/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
| Language | Github Actions | Coveralls |Gitter.im |
|:--------:|:--------------:|:---------:|:--------:|
| ![GitHub top language](https://img.shields.io/github/languages/top/lehins/Color.svg) | [![Build Status](https://github.com/lehins/Color/workflows/Color-CI/badge.svg)](https://github.com/lehins/Color/actions) | [![Coverage Status](https://coveralls.io/repos/github/lehins/Color/badge.svg?branch=master)](https://coveralls.io/github/lehins/Color?branch=master) | [![Join the chat at https://gitter.im/haskell-massiv/Lobby](https://badges.gitter.im/haskell-massiv/Lobby.svg)](https://gitter.im/haskell-massiv/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

| Package | Hackage | Nightly | LTS |
|:-------------------|:-------:|:-------:|:---:|
Expand Down
2 changes: 2 additions & 0 deletions stack-coveralls.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# There is no way to pass `--resolver lts-14.27` to `shc` (stack-hpc-coveralls), so we
# keep around a special stack-yaml file for it.
resolver: lts-14.27
packages:
- Color
Expand Down

0 comments on commit c970293

Please sign in to comment.