Skip to content

Commit

Permalink
Fix broken build due to happy-1.21.0
Browse files Browse the repository at this point in the history
haskell/happy#211

[changelog skip]
  • Loading branch information
dahlia committed Nov 17, 2021
1 parent aa44d24 commit 6be742c
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 46 deletions.
54 changes: 24 additions & 30 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-10.15, windows-2019]
resolver:
- lts-16.31
- lts-18.16
- nightly-2021-11-06
ghc-version:
- "8.8"
- "8.10"
- "9.0"
env:
STACK_YAML: "${{ github.workspace }}/stack-ghc-${{ matrix.ghc-version }}"
steps:
- uses: actions/checkout@v2
- uses: dahlia/actions/setup-yq@main
Expand All @@ -28,7 +30,7 @@ jobs:
~/.cabal/packages
~/.cabal/store
~/.stack
key: stack-${{ matrix.os }}-${{ matrix.resolver }}
key: stack-${{ matrix.os }}-ghc-${{ matrix.ghc-version }}
- name: Cache Stack files (Windows)
if: "startsWith(matrix.os, 'windows-')"
uses: actions/cache@v2
Expand All @@ -37,25 +39,17 @@ jobs:
%APPDATA%\cabal\packages
%APPDATA%\cabal\store
%APPDATA%\stack
key: stack-${{ matrix.os }}-${{ matrix.resolver }}
key: stack-${{ matrix.os }}-ghc-${{ matrix.version }}
- name: Adjust Stack configuration
shell: bash
if: "!startsWith(matrix.os, 'windows-')"
run: |
yq eval -i '
.resolver = strenv(RESOLVER)
| .allow-newer = (
.resolver | test("^lts-18.") or
.resolver | test("^nightly-")
)
| .flags.seonbi.iconv = (strenv(OS) | test("^windows-") | not)
' stack.yaml
env:
RESOLVER: ${{ matrix.resolver }}
OS: ${{ matrix.os }}
yq eval \
-i \
'.flags.seonbi.iconv = true' \
stack-ghc-${{ matrix.ghc-version }}.yaml
- name: Set up resolver
shell: bash
run: |
cat stack.yaml
# Try 3 times because this sometimes fails due to network error
# on GitHub Actions.
stack setup || stack setup || stack setup
Expand All @@ -72,9 +66,9 @@ jobs:
[[ "$tag_ver" = "$pkg_ver" ]]
! grep -i "to be released" CHANGES.md
- name: Resolve dependencies
run: stack install --only-dependencies
run: stack install --test --only-dependencies
- name: Build
run: stack build
run: stack build --test
- name: Test
run: stack test
- name: Package source distribution
Expand All @@ -90,12 +84,12 @@ jobs:
if: startsWith(matrix.os, 'ubuntu-')
uses: actions/upload-artifact@v2
with:
name: sdist-${{ matrix.os }}-${{ matrix.resolver }}
name: sdist-${{ matrix.os }}-ghc-${{ matrix.ghc-version }}
path: /tmp/sdist
- name: Build docs
if: >-
startsWith(matrix.os, 'ubuntu-') &&
startsWith(matrix.resolver, 'lts-18.')
matrix.ghc-version == '8.8'
shell: bash
run: |
curl -L -o /tmp/pandoc.deb \
Expand All @@ -109,13 +103,13 @@ jobs:
- name: Copy docs
if: >-
startsWith(matrix.os, 'ubuntu-') &&
startsWith(matrix.resolver, 'lts-18.')
matrix.ghc-version == '8.8'
shell: bash
run: cp -r "$(stack path --dist-dir)/doc/html/seonbi" .docs
- name: Save docs
if: >-
startsWith(matrix.os, 'ubuntu-') &&
startsWith(matrix.resolver, 'lts-18.')
matrix.ghc-version == '8.8'
uses: actions/upload-artifact@v2
with:
name: docs
Expand All @@ -134,7 +128,7 @@ jobs:
- name: Save executable binaries
uses: actions/upload-artifact@v2
with:
name: binaries-${{ matrix.os }}-${{ matrix.resolver }}
name: binaries-${{ matrix.os }}-ghc-${{ matrix.ghc-version }}
path: .bin

deno:
Expand All @@ -153,7 +147,7 @@ jobs:
deno-version: v1.x
- uses: actions/download-artifact@v2
with:
name: binaries-${{ matrix.os }}-lts-16.31
name: binaries-${{ matrix.os }}-ghc-8.8
path: ${{ runner.temp }}/bin
- run: chmod +x ${{ runner.temp }}/bin/*
if: "!startsWith(matrix.os, 'windows-')"
Expand Down Expand Up @@ -271,11 +265,11 @@ jobs:
steps:
- uses: actions/download-artifact@v2
with:
name: binaries-macos-10.15-lts-16.31
name: binaries-macos-10.15-ghc-8.8
path: /tmp/binaries-macos
- uses: actions/download-artifact@v2
with:
name: binaries-windows-2019-lts-16.31
name: binaries-windows-2019-ghc-8.8
path: /tmp/binaries-windows
- uses: actions/download-artifact@v2
with:
Expand Down Expand Up @@ -329,7 +323,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: sdist-ubuntu-20.04-lts-16.31
name: sdist-ubuntu-20.04-ghc-8.8
path: /tmp/sdist
- uses: actions/download-artifact@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ dist-newstyle/
out/
seonbi.iml
src/Text/Seonbi/kHangul.txt
stack.yaml.lock
stack*.yaml.lock
13 changes: 13 additions & 0 deletions stack-ghc-8.10.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
resolver: lts-18.16
packages:
- .
extra-deps:
- bytestring-trie-0.2.5.0
- html-charset-0.1.0
flags:
seonbi:
iconv: true
allow-newer: true
ghc-options:
"$locals": -fhide-source-paths
require-stack-version: ">=2.7.0"
13 changes: 13 additions & 0 deletions stack-ghc-8.8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
resolver: lts-16.31
packages:
- .
extra-deps:
- bytestring-trie-0.2.5.0
- html-charset-0.1.0
flags:
seonbi:
iconv: true
allow-newer: false
ghc-options:
"$locals": -fhide-source-paths
require-stack-version: ">=2.7.0"
14 changes: 14 additions & 0 deletions stack-ghc-9.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
resolver: nightly-2021-11-15
packages:
- .
extra-deps:
- bytestring-trie-0.2.5.0
- html-charset-0.1.0
- happy-1.20.0 # https://github.com/simonmar/happy/issues/211
flags:
seonbi:
iconv: true
allow-newer: true
ghc-options:
"$locals": -fhide-source-paths
require-stack-version: ">=2.7.0"
15 changes: 0 additions & 15 deletions stack.yaml

This file was deleted.

1 change: 1 addition & 0 deletions stack.yaml

0 comments on commit 6be742c

Please sign in to comment.