Skip to content

Commit

Permalink
Use Github action to upload package to Hackage
Browse files Browse the repository at this point in the history
Aso split `CI` worflow into `branch` & `master`
  • Loading branch information
EduardSergeev committed Sep 20, 2020
2 parents 3b74c96 + 60136ab commit 4ef57d9
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 44 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/branch.yml
@@ -0,0 +1,14 @@
name: branch

on:
push:
branches-ignore:
- master

jobs:
stack-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: stack build
- run: stack test
39 changes: 24 additions & 15 deletions .github/workflows/ci.yml → .github/workflows/master.yml
@@ -1,23 +1,24 @@
name: CI
name: master

on:
push:
branches:
- master
tags:
- '[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches:
- master

jobs:
stack-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Build project
run: stack build

- name: Run tests
run: stack test
- run: stack build
- run: stack test

cabal-build:
if: github.ref == 'refs/heads/master' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -30,32 +31,40 @@ jobs:
- run: cabal sdist

metrics:
if: github.ref == 'refs/heads/master' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
env:
LCOV_PATH: ./lcov.info
# TODO: Remove this restriction once `stack test --coverage` is fixed in the next Stack release
STACK_YAML: stack-8.6.5.yaml
steps:
- uses: actions/checkout@v2

- name: Add $HOME/.local/bin to PATH
run: echo "::add-path::$HOME/.local/bin"

- name: Run tests with coverage
run: stack test --coverage

- name: Install hpc-lcov
run: stack install hpc-lcov

- name: Convert coverage results to LCOV format
run: hpc-lcov -o ${{ env.LCOV_PATH }}

- name: Upload coverage to Coverall
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ${{ env.LCOV_PATH }}

- name: Run benchmarks
run: stack bench

hackage-upload:
if: github.event_name == 'push' && startsWith(github.event.base_ref, 'refs/heads/master')
needs:
- stack-build
- cabal-build
- metrics
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Upload version to Hackage
env:
HACKAGE_USERNAME: ${{ secrets.HACKAGE_USERNAME }}
HACKAGE_PASSWORD: ${{ secrets.HACKAGE_PASSWORD }}
run: stack upload .
5 changes: 5 additions & 0 deletions .vscode/settings.json
Expand Up @@ -5,5 +5,10 @@
"dist*": true,
".stack-work": true,
"**/cabal.project.local": true
},
"markdownlint.config": {
"MD022": false,
"MD024": false,
"MD032": false
}
}
44 changes: 44 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,44 @@
# Change Log
All notable changes to the `monad-memo` project will be documented in this file

## [0.5.2] - 2020-09-20
### Added
- CI on Github actions with test coverage and Hackage upload
### Fixed
- `monad-memo.cabal` structure: redundancy and to enable test coverage calculation
- `CHANGELOG.md` structure

## [0.5.1] - 2018-08-31
### Added
- Support multiple mutable caches in transformers stack
This allows Array/Vector-based caches to be used for mutually recursive function memoization

## [0.5.0] - 2018-08-06
### Fixed
- Refresh project to be compilable with latest GHC and libraries
- Remove dependency on `mtl` package (`transformers` is sufficient)
- Use `Except` instead of deprecated `Error`
- Remove support for `ListT` transformer since it is now deprecated
- Use standard `StateT` & `ReaderT` for `MonadCache` implementations

## [0.4.1] - 2013-03-06
### Fixed
- Documentation
- `Example` is renamed to `example` and is excluded from package's module hierarchy

## [0.4.0] - 2013-02-26
### Added
- `ArrayCache`: mutable array-based `MonadCache` for top performance
- `VectorCache` (and flavours) `vector`-based `MonadCache` for even better performance
- Simple benchmark included
### Fixed
- Bug fixes in transformer implementations (`Reader`, `State`, `RWS`)

## [0.3.0] - 2011-04-03
### Added
- Added generalized `MemoStateT` transformer (to host any `Data.MapLike` cache-container)
- `MemoT` is now `MemoStateT` instantiated with `Data.Map`

## [0.2.0] - 2011-03-27
### Added
- A set of `forX` functions (`for2`, `for3` and `for4`) to adapt curried function into uncurried `MemoCache`
28 changes: 0 additions & 28 deletions CHANGES

This file was deleted.

2 changes: 1 addition & 1 deletion monad-memo.cabal
Expand Up @@ -61,7 +61,7 @@ Tested-with:
GHC==8.8.4

Extra-source-files:
CHANGES,
CHANGELOG.md,
README.md,
example/*.hs,
example/Customisation/*.hs
Expand Down

0 comments on commit 4ef57d9

Please sign in to comment.