Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions #238

Merged
merged 35 commits into from
Dec 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3b1e0ab
GitHub Actions
gelisam Dec 27, 2020
5e445de
use the right version of ghc
gelisam Dec 27, 2020
d742a32
use the designated OS
gelisam Dec 27, 2020
b01caf4
focus on the happy failure
gelisam Dec 27, 2020
b24e3a5
Revert "focus on the happy failure"
gelisam Dec 27, 2020
8a19e26
focus on the happy failure
gelisam Dec 27, 2020
cbd6e26
install happy from a different lts
gelisam Dec 28, 2020
c9f79d3
examine the build environment
gelisam Dec 28, 2020
7d74d0e
maybe on multiple lines?
gelisam Dec 28, 2020
832bcb8
come on, GitHub.
gelisam Dec 28, 2020
e47e6a9
Revert "come on, GitHub."
gelisam Dec 28, 2020
c6a8144
Revert "maybe on multiple lines?"
gelisam Dec 28, 2020
cb4ef88
Revert "examine the build environment"
gelisam Dec 28, 2020
7628737
add ~/.local/bin to the path
gelisam Dec 28, 2020
4856f17
Revert "focus on the happy failure"
gelisam Dec 28, 2020
68313ba
only add to the PATH when needed
gelisam Dec 28, 2020
4ea083a
focus on the failing macOS test
gelisam Dec 28, 2020
6769639
focus on the failure
gelisam Dec 28, 2020
3c66515
delete corrupted HSinteger-gmp file
gelisam Dec 28, 2020
2f091af
examine the build environment
gelisam Dec 28, 2020
1b50726
delete corrupted file later
gelisam Dec 28, 2020
fffe569
hand-revert 'examine the build environment'
gelisam Dec 28, 2020
85ec26f
Revert "focus on the failure"
gelisam Dec 28, 2020
cfcebdd
Revert "focus on the failing macOS test"
gelisam Dec 28, 2020
d3d2fe5
focus on the failing macOS test
gelisam Dec 28, 2020
7e87dfd
clarify that not all ghc versions have this problem
gelisam Dec 28, 2020
8daaea2
clarify why there are two build steps
gelisam Dec 28, 2020
ff38144
examine the build environment
gelisam Dec 28, 2020
74294c2
examine more
gelisam Dec 28, 2020
7de7b68
skip the cache
gelisam Dec 28, 2020
1fd25a0
use a new cache
gelisam Dec 28, 2020
74a5ae0
Revert "examine more"
gelisam Dec 29, 2020
9e1495e
Revert "examine the build environment"
gelisam Dec 29, 2020
cb2a547
Revert "focus on the failing macOS test"
gelisam Dec 29, 2020
68a7b01
don't run CI on Windows
gelisam Dec 29, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 142 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: CI

on:
# Build every pull request, to check for regressions.
pull_request:

# Build when a PR is merged, to update the README's CI badge.
push:
branches: [main]

# Build once a month, to detect missing upper bounds.
schedule:
- cron: '0 0 1 * *'

jobs:
stack:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Check that the build passes with the recommended snapshot on every
# platform.
- name: stable (Linux)
stack_yaml: "stack.yaml"
os: ubuntu-latest
- name: stable (MacOS)
stack_yaml: "stack.yaml"
os: macos-latest

# Not currently running CI on Windows, see #239
#- name: stable (Windows)
# stack_yaml: "stack.yaml"
# os: windows-latest

# Check that the lower bounds are still correct by building with the
# lowest-supported version of everything, including our dependencies.
- name: oldest
stack_yaml: "oldest-supported-lts.yaml"
os: ubuntu-latest

steps:
- uses: actions/checkout@v2
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'

- uses: actions/cache@v2
name: Cache Stack Artifacts
with:
path: |
~/.stack
~/.local/bin
.stack-work
key: ${{ runner.os }}-stack-${{ hashFiles(matrix.stack_yaml) }}-2

- uses: haskell/actions/setup@v1
id: setup-haskell-stack
name: Setup Stack
with:
enable-stack: true
stack-setup-ghc: true
stack-no-global: true

# For some reason, installing happy from lts-8.0 fails unless some other
# version of happy is already in the PATH. So let's install a version of
# happy from an lts which does not have this problem.
- name: Install happy
if: matrix.stack_yaml == 'oldest-supported-lts.yaml'
run: |
stack --stack-yaml=stack.yaml install happy
- name: Build with happy hack
if: matrix.stack_yaml == 'oldest-supported-lts.yaml'
run: |
PATH="$HOME/.local/bin:$PATH" stack --stack-yaml=${{ matrix.stack_yaml }} build --test --bench --no-run-tests --no-run-benchmarks
- name: Build
if: matrix.stack_yaml == 'stack.yaml'
run: |
stack --stack-yaml=${{ matrix.stack_yaml }} build --test --bench --no-run-tests --no-run-benchmarks
# For some reason, the HSinteger-gmp-1.0.2.0.o file which comes with ghc-8.4.4 is
# corrupted, and builds fail unless it is deleted. Apparently it is not needed?
- name: Fix HSinteger-gmp
if: matrix.os == 'macos-latest'
run: |
rm -f ~/.stack/programs/x86_64-osx/ghc-*/lib/ghc-*/integer-gmp-*/HSinteger-gmp-*.o
- name: Test
run: |
stack --stack-yaml=${{ matrix.stack_yaml }} test
cabal:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Check that our upper bounds are correct by building with the latest
# version of everything. We use cabal because it uses the latest
# versions of our dependencies allowed by our upper bounds.
- name: newest
ghc: 8.4.4
os: ubuntu-latest

steps:
- uses: actions/checkout@v2
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'

- uses: haskell/actions/setup@v1
id: setup-haskell-cabal
name: Setup Cabal
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}

# This freeze file is regenerated on every build, so we will always test
# with the most recent version of our dependencies allowed by our upper
# bounds.
- name: Freeze
run: |
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
cabal freeze
cabal v1-sandbox init
cabal v1-install happy
# Only reuse the cached copy of our dependencies if our freeze file matches
# the cache's copy.
- uses: actions/cache@v2
name: Cache Cabal Artifacts
with:
path: |
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
.cabal-sandbox
key: ${{ runner.os }}-cabal-${{ hashFiles('cabal.project.freeze') }}

- name: Build
run: |
cabal v1-install --enable-tests
- name: Test
run: |
cabal v1-test
File renamed without changes.