Skip to content

Commit

Permalink
Merge branch 'main' into BFS
Browse files Browse the repository at this point in the history
  • Loading branch information
byorgey committed Nov 24, 2023
2 parents 6d5d0b2 + 44c2e60 commit 0ce598e
Show file tree
Hide file tree
Showing 471 changed files with 25,306 additions and 5,120 deletions.
70 changes: 41 additions & 29 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.15.20221009
# version: 0.16.3
#
# REGENDATA ("0.15.20221009",["github","--config=cabal.haskell-ci","--copy-fields=all","swarm.cabal"])
# REGENDATA ("0.16.3",["github","--config=cabal.haskell-ci","--copy-fields=all","swarm.cabal"])
#
name: Haskell-CI
on:
Expand Down Expand Up @@ -57,24 +57,24 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.4.2
- compiler: ghc-9.6.2
compilerKind: ghc
compilerVersion: 9.4.2
compilerVersion: 9.6.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.2.4
- compiler: ghc-9.4.5
compilerKind: ghc
compilerVersion: 9.2.4
compilerVersion: 9.4.5
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.0.2
- compiler: ghc-9.2.7
compilerKind: ghc
compilerVersion: 9.0.2
compilerVersion: 9.2.7
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.10.7
- compiler: ghc-9.0.2
compilerKind: ghc
compilerVersion: 8.10.7
compilerVersion: 9.0.2
setup-method: ghcup
allow-failure: false
fail-fast: false
Expand All @@ -84,10 +84,10 @@ jobs:
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.18.0/x86_64-linux-ghcup-0.1.18.0 > "$HOME/.ghcup/bin/ghcup"
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -103,7 +103,7 @@ jobs:
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -151,36 +151,42 @@ jobs:
run: |
$CABAL v2-update -v
- name: cache (tools)
uses: actions/cache@v2
uses: actions/cache/restore@v3
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-0367592e
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-1d2d1963
path: ~/.haskell-ci-tools
- name: install cabal-plan
run: |
mkdir -p $HOME/.cabal/bin
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz
echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.7.3.0/cabal-plan-0.7.3.0-x86_64-linux.xz > cabal-plan.xz
echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
rm -f cabal-plan.xz
chmod a+x $HOME/.cabal/bin/cabal-plan
cabal-plan --version
- name: install cabal-docspec
run: |
mkdir -p $HOME/.cabal/bin
curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20211114/cabal-docspec-0.0.0.20211114.xz > cabal-docspec.xz
echo 'e224700d9e8c9ec7ec6bc3f542ba433cd9925a5d356676c62a9bd1f2c8be8f8a cabal-docspec.xz' | sha256sum -c -
curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20230517/cabal-docspec-0.0.0.20230517-x86_64-linux.xz > cabal-docspec.xz
echo '3b31bbe463ad4d671abbc103db49628562ec48a6604cab278207b5b6acd21ed7 cabal-docspec.xz' | sha256sum -c -
xz -d < cabal-docspec.xz > $HOME/.cabal/bin/cabal-docspec
rm -f cabal-docspec.xz
chmod a+x $HOME/.cabal/bin/cabal-docspec
cabal-docspec --version
- name: install hlint
run: |
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then HLINTVER=$(cd /tmp && (${CABAL} v2-install -v $ARG_COMPILER --dry-run hlint --constraint='hlint >=3.5 && <3.6' | perl -ne 'if (/\bhlint-(\d+(\.\d+)*)\b/) { print "$1"; last; }')); echo "HLint version $HLINTVER" ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then if [ ! -e $HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint ]; then echo "Downloading HLint version $HLINTVER"; mkdir -p $HOME/.haskell-ci-tools; curl --write-out 'Status Code: %{http_code} Redirects: %{num_redirects} Total time: %{time_total} Total Dsize: %{size_download}\n' --silent --location --output $HOME/.haskell-ci-tools/hlint-$HLINTVER.tar.gz "https://github.com/ndmitchell/hlint/releases/download/v$HLINTVER/hlint-$HLINTVER-x86_64-linux.tar.gz"; tar -xzv -f $HOME/.haskell-ci-tools/hlint-$HLINTVER.tar.gz -C $HOME/.haskell-ci-tools; fi ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then mkdir -p $CABAL_DIR/bin && ln -sf "$HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint" $CABAL_DIR/bin/hlint ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then hlint --version ; fi
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then HLINTVER=$(cd /tmp && (${CABAL} v2-install -v $ARG_COMPILER --dry-run hlint --constraint='hlint >=3.5 && <3.6' | perl -ne 'if (/\bhlint-(\d+(\.\d+)*)\b/) { print "$1"; last; }')); echo "HLint version $HLINTVER" ; fi
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then if [ ! -e $HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint ]; then echo "Downloading HLint version $HLINTVER"; mkdir -p $HOME/.haskell-ci-tools; curl --write-out 'Status Code: %{http_code} Redirects: %{num_redirects} Total time: %{time_total} Total Dsize: %{size_download}\n' --silent --location --output $HOME/.haskell-ci-tools/hlint-$HLINTVER.tar.gz "https://github.com/ndmitchell/hlint/releases/download/v$HLINTVER/hlint-$HLINTVER-x86_64-linux.tar.gz"; tar -xzv -f $HOME/.haskell-ci-tools/hlint-$HLINTVER.tar.gz -C $HOME/.haskell-ci-tools; fi ; fi
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then mkdir -p $CABAL_DIR/bin && ln -sf "$HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint" $CABAL_DIR/bin/hlint ; fi
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then hlint --version ; fi
- name: save cache (tools)
uses: actions/cache/save@v3
if: always()
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-1d2d1963
path: ~/.haskell-ci-tools
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: source
- name: initial cabal.project for sdist
Expand Down Expand Up @@ -216,8 +222,8 @@ jobs:
run: |
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
cabal-plan
- name: cache
uses: actions/cache@v2
- name: restore cache
uses: actions/cache/restore@v3
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
Expand All @@ -238,12 +244,18 @@ jobs:
cabal-docspec $ARG_COMPILER
- name: hlint
run: |
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then (cd ${PKGDIR_swarm} && hlint -h ${GITHUB_WORKSPACE}/source/.hlint.yaml -XHaskell2010 -XBangPatterns -XDeriveAnyClass -XDeriveDataTypeable -XDeriveFunctor -XDeriveGeneric -XDeriveTraversable -XExplicitForAll -XFlexibleContexts -XFlexibleInstances -XGADTSyntax -XMultiParamTypeClasses -XNumericUnderscores -XRankNTypes -XScopedTypeVariables -XStandaloneDeriving -XTupleSections -XTypeApplications -XTypeOperators -XImportQualifiedPost -XLambdaCase -XStrictData src) ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then (cd ${PKGDIR_swarm} && hlint -h ${GITHUB_WORKSPACE}/source/.hlint.yaml -XHaskell2010 -XImportQualifiedPost app) ; fi
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then (cd ${PKGDIR_swarm} && hlint -h ${GITHUB_WORKSPACE}/source/.hlint.yaml -XHaskell2010 -XBangPatterns -XDeriveAnyClass -XDeriveDataTypeable -XDeriveFunctor -XDeriveGeneric -XDeriveTraversable -XExplicitForAll -XFlexibleContexts -XFlexibleInstances -XGADTSyntax -XMultiParamTypeClasses -XNumericUnderscores -XRankNTypes -XScopedTypeVariables -XStandaloneDeriving -XTupleSections -XTypeApplications -XTypeOperators -XImportQualifiedPost -XLambdaCase -XStrictData src) ; fi
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then (cd ${PKGDIR_swarm} && hlint -h ${GITHUB_WORKSPACE}/source/.hlint.yaml -XHaskell2010 -XImportQualifiedPost app) ; fi
- name: cabal check
run: |
cd ${PKGDIR_swarm} || false
${CABAL} -vnormal check
- name: haddock
run: |
$CABAL v2-haddock --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
- name: save cache
uses: actions/cache/save@v3
if: always()
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
28 changes: 28 additions & 0 deletions .github/workflows/scenario-schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: JSON schema
on:
push:
paths:
- 'data/scenarios/**.yaml'
branches:
- main
pull_request:
paths:
- 'data/scenarios/**.yaml'
branches:
- main
jobs:
validate-scenario-schema:
name: Validate scenarios against schema
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install check-jsonschema
- run: |
scripts/validate-json-schemas.sh
7 changes: 6 additions & 1 deletion .github/workflows/vscode-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,9 @@ jobs:
with:
packagePath: editors/vscode
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
registryUrl: https://marketplace.visualstudio.com
- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v1
with:
packagePath: editors/vscode
pat: ${{ secrets.VSX_MARKETPLACE_TOKEN }}
13 changes: 10 additions & 3 deletions .hlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,16 @@
# - {name: [Data.Set, Data.HashSet], as: Set} # if you import Data.Set qualified, it must be as 'Set'
# - {name: Control.Arrow, within: []} # Certain modules are banned entirely
#
# - functions:
# - {name: unsafePerformIO, within: []} # unsafePerformIO can only appear in no modules

- functions:
- {name: Data.List.head, within: []}
- {name: Prelude.head, within: []}
- {name: Data.List.NonEmpty.fromList, within: [Swarm.Util]}
- {name: Prelude.tail, within: []}
- {name: Prelude.!!, within: [Swarm.Util.indexWrapNonEmpty, TestEval]}
- {name: undefined, within: [Swarm.Language.Key, TestUtil]}
- {name: fromJust, within: []}
# - {name: Data.Map.!, within: []} # TODO: #1494
# - {name: error, within: []} # TODO: #1494

# Add custom hints for this project
#
Expand Down
12 changes: 6 additions & 6 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ queue_rules:
- or:
- check-success=Enforce issue references
- -files~=\.hs$
- check-success=Haskell-CI - Linux - ghc-9.4.2
- check-success=Haskell-CI - Linux - ghc-9.2.4
- check-success=Haskell-CI - Linux - ghc-9.6.2
- check-success=Haskell-CI - Linux - ghc-9.4.5
- check-success=Haskell-CI - Linux - ghc-9.2.7
- check-success=Haskell-CI - Linux - ghc-9.0.2
- check-success=Haskell-CI - Linux - ghc-8.10.7

pull_request_rules:
- actions:
Expand All @@ -44,10 +44,10 @@ pull_request_rules:
- or:
- check-success=Enforce issue references
- -files~=\.hs$
- check-success=Haskell-CI - Linux - ghc-9.4.2
- check-success=Haskell-CI - Linux - ghc-9.2.4
- check-success=Haskell-CI - Linux - ghc-9.6.2
- check-success=Haskell-CI - Linux - ghc-9.4.5
- check-success=Haskell-CI - Linux - ghc-9.2.7
- check-success=Haskell-CI - Linux - ghc-9.0.2
- check-success=Haskell-CI - Linux - ghc-8.10.7
- label=merge me
- ! '#approved-reviews-by>=1'
- ! '#changes-requested-reviews-by=0'
Expand Down
2 changes: 1 addition & 1 deletion .restyled.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
restylers_version: stable
restylers:
- fourmolu:
image: 'restyled/restyler-fourmolu:v0.10.1.0'
image: 'restyled/restyler-fourmolu:v0.13.0.0'
arguments:
[]
14 changes: 14 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"yaml.schemas": {
"data/schema/scenario.json": [
"data/scenarios/**/*.yaml",
"scenarios/**/*.yaml"
],
"data/schema/entities.json": [
"data/entities.yaml"
],
"data/schema/recipes.json": [
"data/recipes.yaml"
],
}
}
Loading

0 comments on commit 0ce598e

Please sign in to comment.