Skip to content

Commit

Permalink
Setup CI using Github Actions (#50)
Browse files Browse the repository at this point in the history
* setup a simple CI using GitHub actions

* describe a simple dev setup process

* build branches with pull requests against master, run build on multiple operating systems

* trigger CI for all branches

* always checkout the ref

* build only on pull_request events not to duplicate builds

* build only on Ubuntu
  • Loading branch information
mjarosie committed Oct 2, 2020
1 parent aeceaeb commit b269ce4
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on:
pull_request:
branches:
- '*'

jobs:
stack:
name: ${{ matrix.os }} / stack / ghc ${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
stack: ["2.3.3"]
ghc: ["8.8.3"]

steps:
- uses: actions/checkout@v2

- uses: actions/setup-haskell@v1.1
name: Setup Haskell Stack
with:
enable-stack: true
stack-no-global: true
stack-setup-ghc: true
stack-version: ${{ matrix.stack }}
ghc-version: ${{ matrix.ghc }}

- uses: actions/cache@v2
name: Cache ~/.stack
with:
path: ~/.stack
key: ${{ matrix.os }}-${{ matrix.ghc }}-stack

- name: Build
run: |
stack build
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![GitHub CI](https://github.com/saurabhnanda/odd-jobs/workflows/CI/badge.svg)](https://github.com/saurabhnanda/odd-jobs/actions)

# Introduction

- [Odd Jobs home page](https://www.haskelltutorials.com/odd-jobs) - contains a description of top-level features of this library
Expand All @@ -14,3 +16,16 @@ If you are already using, or considering using, `odd-jobs` in production, please
# Contributing

Please read the [contribution guidelines](./CONTRIBUTING.md)

## Development

### Prerequisites

- [The Haskell Tool Stack](https://docs.haskellstack.org/en/stable/README/#how-to-install)
- `libpq-dev` library (required for PostgreSQL dependency)

### Build

```bash
stack build
```

0 comments on commit b269ce4

Please sign in to comment.