Skip to content

Commit

Permalink
Generate CI Artifacts (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
mightybyte authored Aug 14, 2021
1 parent 8b0831e commit b3af5a9
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 47 deletions.
105 changes: 62 additions & 43 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,47 +1,66 @@
name: Build
on:
pull_request:
push:
branches:
- master
name: Build project

on: push

jobs:
build:
name: CI
runs-on: ubuntu-latest
name: Build master with ${{ matrix.ghc }} / ${{ matrix.cabal }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ghc: ['8.8.4']
cabal: ['3.4']
os: ['ubuntu-18.04', 'ubuntu-20.04', 'macOS-latest']

steps:
- name: 'GitHub actions env workaround'
run: 'echo "ACTIONS_ALLOW_UNSECURE_COMMANDS=true" >> $GITHUB_ENV'

- name: Install non-Haskell dependencies
run: |
sudo apt-get update
sudo apt-get install -y git zlib1g-dev libtinfo-dev libsqlite3-dev libz3-dev
- name: Setup Z3
uses: pavpanchekha/setup-z3@1.2.2
with:
version: "4.8.7"
architecture: "x64"

- name: Setup GHC
uses: actions/setup-haskell@v1
with:
ghc-version: "8.8.3"

- name: Setup Stack
uses: mstksg/setup-stack@master

- name: Clone project
uses: actions/checkout@v2

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.stack
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }}
restore-keys: |
${{ runner.os }}-
- name: Build and run tests
run: "stack test --fast --no-terminal"
- name: 'GitHub actions env workaround'
run: 'echo "ACTIONS_ALLOW_UNSECURE_COMMANDS=true" >> $GITHUB_ENV'

# Setup
- name: Checkout repository
uses: actions/checkout@v1

# Haskell Setup
- name: Install GHC and Cabal
uses: haskell/actions/setup@v1.2.3
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Confirm GHC and Cabal installation
run: |
ghc --version
cabal --version
# Project Setup
- uses: actions/cache@v2
name: Cache dist-newstyle
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ matrix.os }}-${{ matrix.ghc }}-4-cabal

# Build
- name: Update package database
run: cabal update
- name: Display outdated packages
run: cabal outdated
- name: Install build dependencies
run: cabal build --only-dependencies
- name: Build
run: cabal build

# Upload artifacts
- name: Copy build artifact
run: cp `cabal list-bin exe:chainweb-data` .
- name: Stripping binary
run: strip chainweb-data
- uses: actions/upload-artifact@v2
with:
name: chainweb-data-build-${{ matrix.os }}
path: chainweb-data

# Test
- name: Test
run: cabal v2-test
4 changes: 3 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/obsidiansystems/gargoyle
tag: b0bf855cc91f7cc3b986083af8fbc9da59c86b56
tag: df0068f9572c1371bed7aa416af84d462c3574c0
subdir:
gargoyle
gargoyle-postgresql
Expand All @@ -47,3 +47,5 @@ write-ghc-environment-files: never

constraints:
sbv == 8.8

allow-newer: gargoyle:base
4 changes: 2 additions & 2 deletions deps/gargoyle/github.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"repo": "gargoyle",
"branch": "develop",
"private": false,
"rev": "b0bf855cc91f7cc3b986083af8fbc9da59c86b56",
"sha256": "0xn76c26cv0rrbzy2cfy4rvx0ssdnnwywxxlngy3dvph0b6dq6s0"
"rev": "df0068f9572c1371bed7aa416af84d462c3574c0",
"sha256": "19amvx6r884ryvy9wq19x7a11fr56kwmw4h2nl8jx0ikzm0sdmfl"
}
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extra-deps:
- github: mightybyte/beam-automigrate
commit: 112c39953c432b05ec6ae2354b0150c61ee30157
- github: obsidiansystems/gargoyle
commit: b0bf855cc91f7cc3b986083af8fbc9da59c86b56
commit: df0068f9572c1371bed7aa416af84d462c3574c0
subdirs:
- gargoyle
- gargoyle-postgresql
Expand Down

0 comments on commit b3af5a9

Please sign in to comment.