Remove check-helpers dependency from the package #118
Workflow file for this run
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
name: Build, test, and deploy | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
paths: | |
- '**.hs' | |
- '**.cabal' | |
- 'Dockerfile' | |
- '**.project' | |
- '.github/workflows/*.yml' | |
branches: | |
- 'master' | |
- '9.8' | |
pull_request: | |
branches: | |
- 'master' | |
paths: | |
- '**.hs' | |
- '**.cabal' | |
- 'Dockerfile' | |
- '**.project' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
ghc: ['9.8', '9.6'] | |
cabal: ['3.10.2.1'] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install ghcup on non-windows | |
run: curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_MINIMAL=1 sh | |
- name: Install ghc/cabal | |
run: | | |
ghcup install ghc ${{ matrix.ghc }} | |
ghcup set ghc ${{ matrix.ghc }} | |
ghcup install cabal ${{ matrix.cabal }} | |
ghcup set cabal ${{ matrix.cabal }} | |
shell: bash | |
- name: Cache | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-cabal | |
with: | |
path: | | |
~/.cabal | |
dist-newstyle | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('*.cabal') }}-${{ hashFiles('cabal.project') }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Update cabal index | |
run: cabal update | |
shell: bash | |
- name: Install dependencies | |
run: | | |
cabal install --lib check-helpers tasty tasty-hunit | |
cabal build --only-dependencies --enable-tests --enable-benchmarks | |
- name: Build | |
run: cabal build --enable-tests --enable-benchmarks all | |
- name: Run tests | |
run: cabal run test | |
- name: Run benchmark | |
run: cabal run benchmark | |
- name: Run slow-test | |
run: cabal run slow-test | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v2 | |
- | |
name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
ghcr.io/tritlo/propr | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=sha | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- | |
name: Login to GHCR | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
build-args: | | |
"HASKELL_VERSION=9.6.4" | |
"PROPR_VERSION=1.0.0" | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |