diff --git a/.github/workflows/mhs.yaml b/.github/workflows/mhs.yaml new file mode 100644 index 00000000..6540e16e --- /dev/null +++ b/.github/workflows/mhs.yaml @@ -0,0 +1,62 @@ +name: mhs-ci + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build-mhs-filepath: + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + # windows doesn't quite work yet + os: [ubuntu-latest, macOS-15-intel, macOS-latest] + mhs: [0.15.0.0] + + steps: + + - name: checkout mhs repo + uses: actions/checkout@v4 + with: + repository: augustss/MicroHs + ref: v${{ matrix.mhs }} + path: mhs + + - name: make and install mhs + if: runner.os == 'Windows' + run: | + cd mhs + nmake /F Makefile.windows + + - name: make and install mhs + if: runner.os != 'Windows' + run: | + cd mhs + make minstall + + - name: install packages + run: | + cd mhs + export PATH="$HOME/.mcabal/bin:$PATH" + make -f Makefile.packages + shell: bash + + - name: checkout filepath repo + uses: actions/checkout@v4 + with: + path: filepath + + - name: compile and install filepath package + run: | + export PATH="$HOME/.mcabal/bin:$PATH" + cd filepath + mcabal -r install + + - name: cleanup + run: | + rm -rf "$HOME/.mcabal" + diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fcfae47c..2d165657 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -7,25 +7,45 @@ on: branches: [ master ] jobs: + tool-output: + runs-on: ubuntu-latest + outputs: + ghc_versions: ${{ steps.gen_output.outputs.ghc_versions }} + + steps: + + - uses: haskell/ghcup-setup@v1 + + - name: Generate output + id: gen_output + run: | + all="$(ghcup -s GHCupURL list -r -t ghc -c available)" + rec=$(echo "${all}" | grep recommended | awk '{ print $2 }') + latest=$(echo "${all}" | grep latest | awk '{ print $2 }') + + other_major=$(echo "${all}" | awk '{ print $2 }' | awk -F '.' '{ print $1 "." $2}' | sort -Vu | tail -${GHC_TEST_NUM:=5}) + other=$(for v in $other_major ; do point_releases=$(echo "$all" | awk '{ print $2 }' | grep --color=never "^$v.") ; echo "${point_releases}" | tail -n1 ; done) + + selected=$(echo -n ${rec} ${latest} ${other} | tr " " "\n" | sort -Vu) + selected_json=$(echo -n $selected | jq -c -r -R 'split(" ") | [ .[] | if length > 0 then . else empty end ]') + + echo "${selected}" + echo "${selected_json}" + + echo ghc_versions="${selected_json}" >> "$GITHUB_OUTPUT" + shell: bash + env: + GHC_TEST_NUM: ${{ vars.GHC_TEST_NUM }} + build: runs-on: ${{ matrix.os }} + needs: ["tool-output"] strategy: fail-fast: false matrix: - os: [ubuntu-latest, macOS-13, windows-latest] - ghc: ['9.4', '9.6', '9.8', '9.10', '9.12'] - include: - - os: ubuntu-latest - ghc: '8.6' - - os: ubuntu-latest - ghc: '8.8' - - os: ubuntu-latest - ghc: '8.10' - - os: ubuntu-latest - ghc: '9.0' - - os: ubuntu-latest - ghc: '9.2' + os: [ubuntu-latest, ubuntu-24.04-arm, macOS-15-intel, macOS-latest, windows-latest] + ghc: ${{ fromJSON(needs.tool-output.outputs.ghc_versions) }} steps: - uses: actions/checkout@v4 @@ -33,7 +53,7 @@ jobs: if: runner.os == 'Linux' run: | sudo apt-get -y update - sudo apt-get -y install libtinfo6 libncurses6 + sudo apt-get -y install build-essential curl libffi-dev libffi8 libgmp-dev libgmp10 libncurses-dev pkg-config libtinfo6 libncurses6 - uses: haskell/ghcup-setup@v1 with: @@ -82,75 +102,6 @@ jobs: cabal update cabal test - # We use github.com/haskell self-hosted runners for ARM testing. - # If they become unavailable in future, put ['armv7', 'aarch64'] - # back to emulation jobs above. - arm: - runs-on: [self-hosted, Linux, ARM64] - strategy: - fail-fast: true - matrix: - arch: [arm32v7, arm64v8] - steps: - - uses: docker://hasufell/arm64v8-ubuntu-haskell:focal - name: Cleanup - with: - args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +" - - - name: Checkout code - uses: actions/checkout@v4 - - - if: matrix.arch == 'arm32v7' - uses: docker://hasufell/arm32v7-ubuntu-haskell:focal - name: Run build (arm32v7 linux) - with: - args: sh -c "cabal update && ghcup install ghc --isolate=/usr --force 9.2.2 && cabal test -w ghc-9.2.2" - - - if: matrix.arch == 'arm64v8' - uses: docker://hasufell/arm64v8-ubuntu-haskell:focal - name: Run build (arm64v8 linux) - with: - args: sh -c "cabal update && ghcup install ghc --isolate=/usr --force 9.2.2 && cabal test -w ghc-9.2.2" - - darwin_arm: - runs-on: ${{ matrix.os }} - env: - MACOSX_DEPLOYMENT_TARGET: 10.13 - HOMEBREW_CHANGE_ARCH_TO_ARM: 1 - strategy: - fail-fast: false - matrix: - include: - - os: [self-hosted, macOS, ARM64] - ghc: 8.10.7 - - os: [self-hosted, macOS, ARM64] - ghc: 9.2.6 - - os: [self-hosted, macOS, ARM64] - ghc: 9.4.4 - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install prerequisites - run: | - bash .github/scripts/brew.sh git coreutils llvm@13 autoconf automake - echo PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$HOME/.brew/opt/llvm@13/bin:$PATH" >> "$GITHUB_ENV" - echo CC="$HOME/.brew/opt/llvm@13/bin/clang" >> "$GITHUB_ENV" - echo CXX="$HOME/.brew/opt/llvm@13/bin/clang++" >> "$GITHUB_ENV" - echo LD=ld >> "$GITHUB_ENV" - echo AR="$HOME/.brew/opt/llvm@13/bin/llvm-ar" >> "$GITHUB_ENV" - echo RANLIB="$HOME/.brew/opt/llvm@13/bin/llvm-ranlib" >> "$GITHUB_ENV" - - - uses: haskell/ghcup-setup@v1 - with: - ghc: ${{ matrix.ghc }} - cabal: latest - - - name: Run build - run: | - cabal update - cabal test - freebsd: runs-on: ${{ matrix.os }} strategy: