Initial trigger for Github Actions based CI.

This commit is contained in:
Tim McGilchrist 2021-06-17 10:25:37 +10:00
parent 41c278d025
commit b9b657d030
7 changed files with 63 additions and 72 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
ghcup set ghc 8.8.4

11
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "GA"
include: "scope"
labels:
- "CI"

45
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,45 @@
name: CI
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
cabal: ["3.4"]
ghc: ["8.0.2", "8.2.2", "8.4.4", "8.6.5", "8.8.4"]
steps:
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v1
id: setup-haskell-cabal
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Cabal Update
run: |
cabal v2-update
cabal v2-freeze $CONFIG
- uses: actions/cache@v2.1.4
with:
path: |
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
dist-newstyle
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ghc }}-
# TODO Enable when codegen is fixed in GA
# - name: Build riak-protobuf-lens
# run: |
# cabal build lib:riak-protobuf-lens
- name: Build riak-protobuf
run: |
cabal build lib:riak-protobuf
- name: Build riak
run: |
cabal build lib:riak

View File

@ -13,12 +13,11 @@ cabal-version: >=1.10
description: A Webmachine-inspired HTTP library based off ideas from the original Erlang project <https://github.com/webmachine/webmachine>
.
A number of examples can be found in <https://github.com/helium/airship/tree/master/example> illustrating how to build airship based services.
tested-with: GHC == 7.10.3,
GHC == 8.0.2,
tested-with: GHC == 8.0.2,
GHC == 8.2.2,
GHC == 8.4.3,
GHC == 8.6.3,
GHC == 8.8.2
GHC == 8.4.4,
GHC == 8.6.5,
GHC == 8.8.4
extra-source-files:
README.md
Changes.md

View File

@ -3,7 +3,7 @@ packages:
example
package airship
ghc-options: -Wall -Werror
ghc-options: -Wall
package example
ghc-options: -Wall -Werror
ghc-options: -Wall

View File

@ -1,2 +0,0 @@
import Distribution.Simple
main = defaultMain

View File

@ -1,63 +0,0 @@
#!/bin/sh -eu
: ${MAFIA_HOME:=$HOME/.mafia}
: ${MAFIA_VERSIONS:=$MAFIA_HOME/versions}
latest_version () {
git ls-remote https://github.com/ambiata/mafia | grep refs/heads/master | cut -f 1
}
build_version() {
MAFIA_VERSION="$1"
MAFIA_TEMP=$(mktemp -d 2>/dev/null || mktemp -d -t 'exec_mafia')
MAFIA_FILE=mafia-$MAFIA_VERSION
MAFIA_PATH=$MAFIA_VERSIONS/$MAFIA_FILE
mkdir -p $MAFIA_VERSIONS
echo "Building $MAFIA_FILE in $MAFIA_TEMP"
git clone https://github.com/ambiata/mafia $MAFIA_TEMP
git --git-dir="$MAFIA_TEMP/.git" --work-tree="$MAFIA_TEMP" reset --hard $MAFIA_VERSION || {
echo "mafia version ($MAFIA_VERSION) could not be found." >&2
exit 1
}
(cd "$MAFIA_TEMP" && ./bin/bootstrap) || {
got=$?
echo "mafia version ($MAFIA_VERSION) could not be built." >&2
exit "$got"
}
chmod +x "$MAFIA_TEMP/.cabal-sandbox/bin/mafia"
# Ensure executable is on same file-system so final mv is atomic.
mv -f "$MAFIA_TEMP/.cabal-sandbox/bin/mafia" "$MAFIA_PATH.$$"
mv "$MAFIA_PATH.$$" "$MAFIA_PATH" || {
rm -f "$MAFIA_PATH.$$"
echo "INFO: mafia version ($MAFIA_VERSION) already exists not overiding," >&2
echo "INFO: this is expected if parallel builds of the same version of" >&2
echo "INFO: mafia occur, we are playing by first in, wins." >&2
exit 0
}
}
enable_version() {
if [ $# -eq 0 ]; then
MAFIA_VERSION="$(latest_version)"
echo "INFO: No explicit mafia version requested installing latest ($MAFIA_VERSION)." >&2
else
MAFIA_VERSION="$1"
fi
[ -x "$MAFIA_HOME/versions/mafia-$MAFIA_VERSION" ] || build_version "$MAFIA_VERSION"
ln -sf "$MAFIA_HOME/versions/mafia-$MAFIA_VERSION" "$MAFIA_HOME/versions/mafia"
}
exec_mafia () {
[ -x "$MAFIA_HOME/versions/mafia" ] || enable_version
"$MAFIA_HOME/versions/mafia" "$@"
}
#
# The actual start of the script.....
#
case "${1:-}" in
upgrade) shift; enable_version "$@" ;;
*) exec_mafia "$@"
esac
# Version: 5dd44a86d71fdef377bc51daeb05b5710a018d20