upgrade to fast-builder 0.1.4.0 #486
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Stack" | |
on: | |
pull_request: | |
push: | |
jobs: | |
dockerimage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: cachix/install-nix-action@v20 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- uses: cachix/cachix-action@v15 | |
with: | |
name: project-m36 | |
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" | |
- run: cachix use iohk | |
- name: docker load | |
run: docker load < $(nix-build docker.nix) | |
- name: docker login | |
if: ${{ github.ref == 'refs/heads/master' }} | |
run: echo ${{secrets.DOCKERHUB_PASSWORD}} | docker login --username ${{secrets.DOCKERHUB_USER}} --password-stdin | |
- name: docker tag with version | |
run: docker tag project-m36:latest projectm36/project-m36:$(awk '/^Version:/ {print $2}' project-m36.cabal) | |
if: ${{ github.ref == 'refs/heads/master' }} | |
- name: docker tag latest | |
run: docker tag project-m36:latest projectm36/project-m36:latest | |
if: ${{ github.ref == 'refs/heads/master' }} | |
- run: docker push projectm36/project-m36 | |
if: ${{ github.ref == 'refs/heads/master' }} | |
stack-build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
ghc_version: | |
- 9.2 | |
- 9.4 | |
# - 9.6 | |
# - 9.8 | |
# - 9.10 | |
include: | |
- os: macos-latest | |
ghc_version: 9.2 | |
env: | |
STACK_YAML: stack.ghc${{ matrix.ghc_version }}.yaml | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.stack | |
key: ${{ runner.os }}-build-stack-ghc${{ matrix.ghc_version }}-${{ hashFiles(env.STACK_YAML) }}-${{ hashFiles('**/*.cabal') }} | |
restore-keys: | | |
${{ runner.os }}-build-stack-ghc${{ matrix.ghc_version }}-${{ hashFiles(env.STACK_YAML) }} | |
${{ runner.os }}-build-stack-ghc${{ matrix.ghc_version }} | |
- name: Fix macOS cache bug | |
run: rm -rf ~/.stack/setup-exe-cache | |
# - name: HLint | |
# run: curl -sSL https://raw.github.com/ndmitchell/hlint/master/misc/run.sh | sh -s . | |
- name: Install ghcup dependencies | |
run: sudo apt-get install build-essential curl libffi-dev libffi8ubuntu1 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5 | |
if: runner.os == 'Linux' | |
- name: Setup GHCUp | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_MINIMAL=1 sh | |
echo "$HOME/.ghcup/bin" >> $GITHUB_PATH | |
ls -al $HOME/.ghcup/bin | |
echo $GITHUB_PATH | |
- name: Install GHC | |
run: ghcup install ghc ${{ matrix.ghc_version }} | |
- name: Install Stack | |
run: ghcup install stack | |
- name: Build | |
run: stack build --ghc-options -O2 --local-bin-path out --copy-bins | |
- name: Test | |
run: stack test --stack-yaml=${{ env.STACK_YAML }} | |
- name: Haddock | |
run: stack --no-install-ghc --system-ghc --no-haddock-deps haddock | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: project-m36-${{ matrix.os }}-ghc${{ matrix.ghc_version }} | |
path: out/ |