Skip to content

ci

ci #107

Workflow file for this run

name: ci
on:
push:
branches:
- main
- release
pull_request:
branches:
- main
- release
workflow_dispatch:
env:
CABAL_VERS: "3.12"
GHC_VERS: "9.12.2"
CABAL_PROJ: "cabal.ghc9122.project"
NAVI_VERS: "0.1"
jobs:
cabal:
strategy:
fail-fast: false
matrix:
ghc:
- vers: "9.6.7"
proj_file: ""
- vers: "9.8.4"
proj_file: ""
- vers: "9.10.2"
proj_file: ""
- vers: "9.12.2"
proj_file: "--project-file cabal.ghc9122.project"
platform:
- os: "macos-latest"
e2e: "RUN_E2E=1"
- os: "ubuntu-latest"
e2e: ""
name: cabal (${{ matrix.ghc.vers }}, ${{ matrix.platform.os }})
runs-on: ${{ matrix.platform.os }}
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc.vers }}
- name: Configure
run: cabal configure ${{ matrix.ghc.proj_file }} --enable-tests --ghc-options -Werror
- name: Compile
run: cabal build ${{ matrix.ghc.proj_file }}
- name: Unit Tests
run: cabal test ${{ matrix.ghc.proj_file }} unit
- name: Integration Tests
run: cabal test ${{ matrix.ghc.proj_file }} integration
- name: End-to-end Tests
shell: bash
run: |
${{ matrix.platform.e2e }} cabal test ${{ matrix.ghc.proj_file }} e2e
- name: Cabal check
run: cabal check
- name: Outdated
run: cabal outdated
nix:
strategy:
fail-fast: false
matrix:
os:
- "macos-latest"
- "ubuntu-latest"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup nix
uses: cachix/install-nix-action@v30
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nix_path: nixpkgs=channel:nixos-unstable
- name: Compile & Test
run: nix build
lint:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- name: Setup nix
uses: cachix/install-nix-action@v30
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nix_path: nixpkgs=channel:nixos-unstable
- name: Formatting
run: |
nix run .#format
git diff --exit-code --color=always
- name: Linting
run: nix run .#lint
release:
needs: [cabal, nix, lint]
if: github.ref == 'refs/heads/release'
strategy:
fail-fast: false
matrix:
platform:
- name: "macos-13"
os: "macos-13"
script: ".github/scripts/release_osx.sh"
script_args: ""
- name: "macos-14"
os: "macos-14"
script: ".github/scripts/release_osx.sh"
script_args: ""
- name: "macos-15"
os: "macos-15"
script: ".github/scripts/release_osx.sh"
script_args: ""
- name: "alpine_amd64"
os: "ubuntu-24.04"
script: ".github/scripts/release_linux.sh"
script_args: "alpine_amd64"
- name: "alpine_arm64v8"
os: "ubuntu-24.04-arm"
script: ".github/scripts/release_linux.sh"
script_args: "alpine_arm64v8"
runs-on: ${{ matrix.platform.os }}
steps:
- uses: actions/checkout@v4
- name: Verify env vars
run: .github/scripts/verify_env.sh
- uses: docker/setup-docker-action@v4
if: ${{ matrix.platform.name == 'alpine_amd64' || matrix.platform.name == 'alpine_arm64v8' }}
# So we have sha256sum
- name: Install coreutils
if: ${{ matrix.platform.os == 'macos-13' || matrix.platform.os == 'macos-14' }}
run: brew install coreutils
- uses: haskell-actions/setup@v2
if: ${{ matrix.platform.name != 'alpine_amd64' && matrix.platform.name != 'alpine_arm64v8' }}
with:
ghc-version: ${{ env.GHC_VERS }}
cabal-version: ${{ env.CABAL_VERS }}
- name: Install binary
shell: bash
run: |
${{ matrix.platform.script }} ${{ matrix.platform.script_args }}
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: release-artifacts-${{ matrix.platform.name }}
path: navi*.zip
retention-days: 1
merge-releases:
runs-on: "ubuntu-latest"
needs: release
steps:
- name: Merge Release Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: release-artifacts
pattern: release-artifacts-*
delete-merged: true
retention-days: 1