-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove doctests as a separate test suite section * Add `cabal.project` * Organaze stack yaml files * Take care of compiler warnings
- Loading branch information
Showing
30 changed files
with
649 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,119 +1,189 @@ | ||
name: Color-CI | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ '*' ] | ||
branches: [ "master", "release/**" ] | ||
pull_request: | ||
branches: [ master ] | ||
branches: [ "**" ] | ||
schedule: | ||
- cron: "0 5 * * 5" | ||
|
||
defaults: { run: { shell: bash } } | ||
|
||
# Cancel running workflows when a new workflow on the same PR or branch is started, | ||
# but put scheduled workflows into their own group | ||
concurrency: | ||
group: ${{ | ||
format('{0}-{1}{2}', | ||
github.workflow, | ||
github.event.pull_request.number || github.ref, | ||
github.event_name == 'schedule' && '-scheduled' || '')}} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: CI | ||
test-with-stack: | ||
name: Stack | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
# resolver: [nightly -- disabled for now, some issue with installing ghc | ||
resolver: [lts-20, lts-19, lts-18, 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 | ||
- resolver: lts-18 | ||
|
||
# Latest stable for MacOS: ghc-8.8.4 | ||
- resolver: lts-16 | ||
os: macos-latest | ||
- resolver: lts-19 | ||
os: macos-latest | ||
- resolver: lts-20 | ||
os: macos-latest | ||
# Latest stable for Windows: ghc-8.6.4 | ||
- resolver: lts-14 | ||
os: windows-latest | ||
- resolver: lts-19 | ||
os: windows-latest | ||
- resolver: lts-20 | ||
os: windows-latest | ||
- { os: Ubuntu-latest, resolver: lts-12, ghc: "8.4.4" } | ||
- { os: Ubuntu-latest, resolver: lts-14, ghc: "8.6.5" } | ||
- { os: Ubuntu-latest, resolver: lts-16, ghc: "8.8.4" } | ||
- { os: Ubuntu-latest, resolver: lts-18, ghc: "8.10.7" } | ||
- { os: Ubuntu-latest, resolver: lts-19, ghc: "9.0.2" } | ||
- { os: Ubuntu-latest, resolver: lts-20, ghc: "9.2.8" } | ||
- { os: Ubuntu-latest, resolver: lts-21, ghc: "9.4.8" } | ||
- { os: Ubuntu-latest, resolver: lts-22, ghc: "9.6.6" } | ||
- { os: Ubuntu-latest, resolver: lts-23, ghc: "9.8.4" } | ||
- { os: Ubuntu-latest, resolver: nightly } | ||
- { os: Windows-latest, resolver: lts-12, ghc: "8.4.4" } | ||
- { os: Windows-latest, resolver: lts-14, ghc: "8.6.5" } | ||
- { os: Windows-latest, resolver: lts-16, ghc: "8.8.4" } | ||
- { os: Windows-latest, resolver: lts-18, ghc: "8.10.7" } | ||
- { os: Windows-latest, resolver: lts-19, ghc: "9.0.2" } | ||
- { os: Windows-latest, resolver: lts-20, ghc: "9.2.8" } | ||
- { os: Windows-latest, resolver: lts-21, ghc: "9.4.8" } | ||
- { os: Windows-latest, resolver: lts-22, ghc: "9.6.6" } | ||
- { os: Windows-latest, resolver: lts-23, ghc: "9.8.4" } | ||
- { os: Windows-latest, resolver: nightly } | ||
- { os: MacOS-13, resolver: lts-12, ghc: "8.4.4" } | ||
- { os: MacOS-13, resolver: lts-14, ghc: "8.6.5" } | ||
- { os: MacOS-13, resolver: lts-16, ghc: "8.8.4" } | ||
- { os: MacOS-13, resolver: lts-18, ghc: "8.10.7" } | ||
- { os: MacOS-13, resolver: lts-19, ghc: "9.0.2" } | ||
- { os: MacOS-latest, resolver: lts-20, ghc: "9.2.8" } | ||
- { os: MacOS-latest, resolver: lts-21, ghc: "9.4.8" } | ||
- { os: MacOS-latest, resolver: lts-22, ghc: "9.6.6" } | ||
- { os: MacOS-latest, resolver: lts-23, ghc: "9.8.4" } | ||
- { os: MacOS-latest, resolver: nightly } | ||
|
||
env: | ||
STACK_YAML: stack.yaml | ||
STACK_ARGS: '--resolver ${{ matrix.resolver }}' | ||
cache-version: v5 # bump up this version to invalidate currently stored cache | ||
STACK_YAML: ${{ matrix.stack-yaml || matrix.ghc != '' && format('stack/ghc-{0}.yaml', matrix.ghc) || 'stack.yaml' }} | ||
STACK_ARGS: '--resolver ${{ matrix.resolver }} --system-ghc' | ||
cache-version: v0 # bump up this version to invalidate currently stored cache | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: haskell-actions/setup@v2 | ||
id: setup-haskell-cabal | ||
name: Setup Haskell | ||
with: | ||
ghc-version: ${{ matrix.ghc }} | ||
enable-stack: true | ||
stack-version: 'latest' | ||
|
||
- name: Cache | ||
id: cache | ||
uses: actions/cache@v2 | ||
if: matrix.os != 'macos-latest' | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.stack | ||
${{ steps.setup-haskell-cabal.outputs.stack-root }} | ||
.stack-work | ||
Color/.stack-work | ||
key: ${{ runner.os }}-${{ matrix.resolver }}-${{ env.cache-version }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.resolver }}-${{ env.cache-version }} | ||
- name: Cache | ||
id: cache-macos | ||
uses: actions/cache@v2 | ||
if: matrix.os == 'macos-latest' | ||
with: | ||
path: | | ||
~/.stack | ||
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-macos.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 | ||
uses: actions/cache@v4 | ||
if: matrix.os == 'windows-latest' | ||
with: | ||
path: | | ||
C:\\Users\\RUNNER~1\\AppData\\Roaming\\stack | ||
C:\\Users\\RUNNER~1\\AppData\\Local\\Programs\\stack | ||
key: ${{ runner.os }}-${{ matrix.resolver }}-programs-${{ env.cache-version }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.resolver }}-programs-${{ env.cache-version }} | ||
- name: Ubuntu install GHC | ||
if: matrix.ghc != '' && matrix.os == 'ubuntu-latest' | ||
- name: Reset modtime | ||
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 | ||
set -ex | ||
curl -sSL https://raw.githubusercontent.com/lehins/utils/master/haskell/git-modtime/git-modtime.hs -o git-modtime.hs | ||
runhaskell -- git-modtime.hs -f .stack-work-root/tree-contents.txt | ||
- name: Build | ||
run: | | ||
set -ex | ||
curl -sSL https://get.haskellstack.org/ | sh -s - -f | ||
curl -sSL https://raw.githubusercontent.com/lehins/utils/786c3fe7e9e1345d7b403019f52e344627224edf/haskell/git-modtime/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 | ||
stack $STACK_ARGS test --no-run-tests --bench --no-run-benchmarks --haddock --no-haddock-deps | ||
- name: Test | ||
env: | ||
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }} | ||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_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 | ||
if [ "${{ matrix.os }}.${{ matrix.resolver }}" == "ubuntu-latest.lts-21" ] && [ -n "${COVERALLS_REPO_TOKEN}" ]; then | ||
stack $STACK_ARGS test --coverage | ||
stack $STACK_ARGS hpc report --all | ||
curl -L https://github.com/rubik/stack-hpc-coveralls/releases/download/v0.0.6.1/shc-linux-x64-8.8.4.tar.bz2 | tar xj shc | ||
./shc --repo-token="$COVERALLS_TOKEN" --partial-coverage --fetch-coverage combined custom | ||
curl -L https://github.com/rubik/stack-hpc-coveralls/releases/download/v0.0.7.0/shc-Linux-X64.tar.bz2 | tar xj shc | ||
./shc --repo-token="$COVERALLS_REPO_TOKEN" --partial-coverage --fetch-coverage combined custom | ||
else | ||
stack $STACK_ARGS test Color:tests Color:doctests --bench --no-run-benchmarks --haddock --no-haddock-deps | ||
stack $STACK_ARGS test | ||
fi | ||
test-with-cabal: | ||
name: Cabal | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- { cabal: "3.12", os: ubuntu-latest, ghc: "8.4.4" } | ||
- { cabal: "3.12", os: ubuntu-latest, ghc: "8.6.5" } | ||
- { cabal: "3.12", os: ubuntu-latest, ghc: "8.8.4" } | ||
- { cabal: "3.12", os: ubuntu-latest, ghc: "8.10.7" } | ||
- { cabal: "3.12", os: ubuntu-latest, ghc: "9.0.2" } | ||
- { cabal: "3.12", os: ubuntu-latest, ghc: "9.2.8" } | ||
- { cabal: "3.12", os: ubuntu-latest, ghc: "9.4.8" } | ||
- { cabal: "3.12", os: ubuntu-latest, ghc: "9.6.6" } | ||
- { cabal: "3.12", os: ubuntu-latest, ghc: "9.8.2" } | ||
- { cabal: "3.12", os: ubuntu-latest, ghc: "9.10.1" } | ||
- { cabal: "3.12", os: windows-latest, ghc: "9.0.2" } | ||
- { cabal: "3.12", os: windows-latest, ghc: "9.2.8" } | ||
- { cabal: "3.12", os: windows-latest, ghc: "9.4.8" } | ||
- { cabal: "3.12", os: windows-latest, ghc: "9.6.6" } | ||
- { cabal: "3.12", os: windows-latest, ghc: "9.8.2" } | ||
- { cabal: "3.12", os: windows-latest, ghc: "9.10.1" } | ||
- { cabal: "3.12", os: macOS-13, ghc: "9.0.2" } | ||
- { cabal: "3.12", os: macOS-latest, ghc: "9.2.8" } | ||
- { cabal: "3.12", os: macOS-latest, ghc: "9.4.8" } | ||
- { cabal: "3.12", os: macOS-latest, ghc: "9.6.6" } | ||
- { cabal: "3.12", os: macOS-latest, ghc: "9.8.2" } | ||
- { cabal: "3.12", os: macOS-latest, ghc: "9.10.1" } | ||
|
||
env: | ||
cache-version: v0 # bump up this version to invalidate currently stored cache | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: haskell-actions/setup@v2 | ||
id: setup-haskell-cabal | ||
name: Setup Haskell | ||
with: | ||
ghc-version: ${{ matrix.ghc }} | ||
cabal-version: ${{ matrix.cabal }} | ||
|
||
- name: Cache Cabal Store | ||
id: cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
${{ steps.setup-haskell-cabal.outputs.cabal-store }} | ||
dist-newstyle | ||
key: cabal-${{ runner.os }}-${{ matrix.ghc }}-${{ env.cache-version }} | ||
restore-keys: | | ||
cabal-${{ runner.os }}-${{ matrix.ghc }}-${{ env.cache-version }} | ||
- name: Build | ||
run: | | ||
set -ex | ||
cabal configure --haddock-all --enable-tests --enable-benchmarks | ||
cabal build all --write-ghc-environment-files=always | ||
- name: Test | ||
run: | | ||
set -ex | ||
cabal test all | ||
- name: Doctest | ||
run: | | ||
set -ex | ||
cabal install doctest --ignore-project --overwrite-policy=always | ||
cabal repl Color --build-depends=QuickCheck --build-depends=JuicyPixels --build-depends=QuickCheck --with-compiler=doctest --repl-options='-w -Wdefault' | ||
- name: Check Cabal Files | ||
run: | | ||
set -ex | ||
cd Color | ||
cabal -vnormal check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.