From fbad1442324b65f07b93e57c257e9a5e878a06e3 Mon Sep 17 00:00:00 2001 From: Karl Ostmo Date: Tue, 16 Jul 2024 18:56:17 -0700 Subject: [PATCH] whitelist weeder.toml --- .github/workflows/haskell-ci.yml | 2 +- .github/workflows/weeder.yml | 43 +++++++++++++++++++++++++++++++- swarm.cabal | 1 + 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 9e40539d9..214269aa4 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -220,7 +220,7 @@ jobs: - name: build run: | $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always - - name: Weeder + - name: weeder uses: freckle/weeder-action@v2 with: ghc-version: ${{ matrix.compilerVersion }} diff --git a/.github/workflows/weeder.yml b/.github/workflows/weeder.yml index 7b47fd3a5..f6762c03a 100644 --- a/.github/workflows/weeder.yml +++ b/.github/workflows/weeder.yml @@ -29,6 +29,47 @@ jobs: setup-method: ghcup allow-failure: false steps: + - name: apt + run: | + 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.30.0/x86_64-linux-ghcup-0.1.30.0 > "$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.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + env: + HCKIND: ${{ matrix.compilerKind }} + HCNAME: ${{ matrix.compiler }} + HCVER: ${{ matrix.compilerVersion }} + - name: Set PATH and environment variables + run: | + echo "$HOME/.cabal/bin" >> $GITHUB_PATH + echo "LANG=C.UTF-8" >> "$GITHUB_ENV" + echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" + echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV" + HCDIR=/opt/$HCKIND/$HCVER + HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER") + HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#') + HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#') + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCPKG" >> "$GITHUB_ENV" + echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV" + echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.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" + echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" + echo "HEADHACKAGE=false" >> "$GITHUB_ENV" + echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" + echo "GHCJSARITH=0" >> "$GITHUB_ENV" + env: + HCKIND: ${{ matrix.compilerKind }} + HCNAME: ${{ matrix.compiler }} + HCVER: ${{ matrix.compilerVersion }} + - name: env + run: | + env - uses: actions/checkout@v4 - name: restore cache uses: actions/cache/restore@v4 @@ -41,7 +82,7 @@ jobs: pwd echo "dir contents:" ls - cabal update + cabal clean cabal build -O0 -j all - uses: freckle/weeder-action@v2 diff --git a/swarm.cabal b/swarm.cabal index a2c57fda5..aa4308f4b 100644 --- a/swarm.cabal +++ b/swarm.cabal @@ -45,6 +45,7 @@ extra-source-files: editors/vim/*.vim editors/vscode/syntaxes/*.yaml example/*.sw + weeder.toml extra-doc-files: docs/image/sublibrary-graph.svg data-dir: data/