Skip to content

Commit

Permalink
Merge pull request #599 from MatthewFluet/msys2-envs-workflow
Browse files Browse the repository at this point in the history
Experiment with alternate msys2 environments in workflows
  • Loading branch information
MatthewFluet authored Jan 2, 2025
2 parents 4db974a + e658681 commit ae18adc
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 31 deletions.
27 changes: 14 additions & 13 deletions .github/actions/install-bootstrap-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ runs:
sudo apt-get install libgmp-dev
if [[ "${{ inputs.install-llvm }}" == "true" ]]; then sudo apt-get install llvm; fi
mkdir boot && cd boot
curl -O -L https://github.com/MLton/mlton/releases/download/on-20210117-release/mlton-20210117-1.amd64-linux-glibc2.31.tgz
tar xzf mlton-20210117-1.amd64-linux-glibc2.31.tgz --exclude='*/share' --strip-components=1
rm mlton-20210117-1.amd64-linux-glibc2.31.tgz
curl -sOL https://github.com/MLton/mlton/releases/download/on-20241230-release/mlton-20241230-1.amd64-linux.ubuntu-20.04_glibc2.31.tgz
tar xzf mlton-20241230-1.amd64-linux.ubuntu-20.04_glibc2.31.tgz --exclude='*/share' --strip-components=1
rm mlton-20241230-1.amd64-linux.ubuntu-20.04_glibc2.31.tgz
- name: Install bootstrap dependencies (macos (amd64))
if: ${{ inputs.runner == 'macos-13' }}
Expand All @@ -31,9 +31,9 @@ runs:
echo "WITH_GMP_DIR=$(brew --prefix)" >> $GITHUB_ENV
if [[ "${{ inputs.install-llvm }}" == "true" ]]; then brew install llvm; echo "$(brew --prefix llvm)/bin" >> $GITHUB_PATH; fi
mkdir boot && cd boot
curl -O -L https://github.com/MLton/mlton/releases/download/on-20210117-release/mlton-20210117-1.amd64-darwin-19.6.gmp-homebrew.tgz
tar xzf mlton-20210117-1.amd64-darwin-19.6.gmp-homebrew.tgz --exclude='*/share' --strip-components=1
rm mlton-20210117-1.amd64-darwin-19.6.gmp-homebrew.tgz
curl -sOL https://github.com/MLton/mlton/releases/download/on-20241230-release/mlton-20241230-1.amd64-darwin.macos-13_gmp-homebrew.tgz
tar xzf mlton-20241230-1.amd64-darwin.macos-13_gmp-homebrew.tgz --exclude='*/share' --strip-components=1
rm mlton-20241230-1.amd64-darwin.macos-13_gmp-homebrew.tgz
- name: Install bootstrap dependencies (macos (arm64))
if: ${{ (inputs.runner == 'macos-14') || (inputs.runner == 'macos-15') }}
Expand All @@ -45,17 +45,18 @@ runs:
echo "WITH_GMP_DIR=$(brew --prefix)" >> $GITHUB_ENV
if [[ "${{ inputs.install-llvm }}" == "true" ]]; then brew install llvm; echo "$(brew --prefix llvm)/bin" >> $GITHUB_PATH; fi
mkdir boot && cd boot
curl -O -L https://projects.laas.fr/tina/software/mlton-20210117-1.arm64-darwin-21.6-gmp-static.tgz
tar xzf mlton-20210117-1.arm64-darwin-21.6-gmp-static.tgz --exclude='*/share' --strip-components=1
rm mlton-20210117-1.arm64-darwin-21.6-gmp-static.tgz
curl -sOL https://github.com/MLton/mlton/releases/download/on-20241230-release/mlton-20241230-1.arm64-darwin.macos-14_gmp-homebrew.tgz
tar xzf mlton-20241230-1.arm64-darwin.macos-14_gmp-homebrew.tgz --exclude='*/share' --strip-components=1
rm mlton-20241230-1.arm64-darwin.macos-14_gmp-homebrew.tgz
- name: Install bootstrap dependencies (windows)
if: ${{ startsWith(inputs.runner, 'windows') }}
shell: 'msys2 {0}'
run: |
# Install dependencies (windows)
pacboy --noconfirm -S --needed gcc:p gmp-devel:
pacboy --noconfirm -S --needed $(if [ ${MSYSTEM} == "CLANG64" ]; then echo clang:p ; else echo gcc:p; fi) gmp:p gmp-devel:
if [[ "${{ inputs.install-llvm }}" == "true" ]]; then pacboy --noconfirm -S --needed llvm:p ; fi
mkdir boot && cd boot
curl -O -L https://github.com/MLton/mlton/releases/download/on-20200817-release/mlton-20200817-amd64-mingw.tgz
tar xzf mlton-20200817-amd64-mingw.tgz --exclude='*/share' --strip-components=1
rm mlton-20200817-amd64-mingw.tgz
curl -sOL https://github.com/MLton/mlton/releases/download/on-20241230-release/mlton-20241230-1.amd64-mingw.windows-2022_MINGW64.tgz
tar xzf mlton-20241230-1.amd64-mingw.windows-2022_MINGW64.tgz --exclude='*/share' --strip-components=1
rm mlton-20241230-1.amd64-mingw.windows-2022_MINGW64.tgz
7 changes: 3 additions & 4 deletions .github/workflows/binary-release-single.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
runner:
required: true
type: string
checkout-ref:
msystem:
required: false
type: string
old-mlton-runtime-args:
Expand All @@ -35,7 +35,7 @@ on:
runner:
required: true
type: string
checkout-ref:
msystem:
required: false
type: string
old-mlton-runtime-args:
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
if: ${{ startsWith(inputs.runner, 'windows') }}
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
msystem: ${{ inputs.msystem }}
update: false
install: >-
base-devel
Expand All @@ -89,7 +89,6 @@ jobs:
uses: actions/checkout@v4
with:
sparse-checkout: .github
ref: ${{ inputs.checkout-ref || 'master' }}

- name: Install bootstrap dependencies
uses: ./.github/actions/install-bootstrap-dependencies
Expand Down
21 changes: 19 additions & 2 deletions .github/workflows/binary-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,32 @@ jobs:
mlton-compile-args: "-gmp-link-opt $(brew --prefix)/lib/libgmp.a"
mlton-binary-release-suffix: ".${RUNNER}_gmp-static"
- runner: "windows-2022"
mlton-binary-release-suffix: ".${RUNNER}_${MSYSTEM}"
msystem: "mingw64"
mlton-binary-release-suffix: ".${RUNNER}_msys2_${MSYSTEM}"
- runner: "windows-2022"
msystem: "mingw64"
mlton-compile-args: "-link-opt -static"
mlton-binary-release-suffix: ".${RUNNER}_${MSYSTEM}_static"
mlton-binary-release-suffix: ".${RUNNER}_msys2_${MSYSTEM}_static"
- runner: "windows-2022"
msystem: "ucrt64"
mlton-binary-release-suffix: ".${RUNNER}_msys2_${MSYSTEM}"
- runner: "windows-2022"
msystem: "ucrt64"
mlton-compile-args: "-link-opt -static"
mlton-binary-release-suffix: ".${RUNNER}_msys2_${MSYSTEM}_static"
- runner: "windows-2022"
msystem: "clang64"
mlton-binary-release-suffix: ".${RUNNER}_msys2_${MSYSTEM}"
- runner: "windows-2022"
msystem: "clang64"
mlton-compile-args: "-link-opt -static"
mlton-binary-release-suffix: ".${RUNNER}_msys2_${MSYSTEM}_static"

uses: ./.github/workflows/binary-release-single.yml
with:
mlton-version: ${{ inputs.mlton-version }}
runner: ${{ matrix.runner }}
msystem: ${{ matrix.msystem }}
old-mlton-runtime-args: ${{ matrix.old-mlton-runtime-args }}
old-mlton-compile-args: ${{ matrix.old-mlton-compile-args }}
mlton-runtime-args: ${{ matrix.mlton-runtime-args }}
Expand Down
72 changes: 60 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,69 @@ jobs:
strategy:
fail-fast: false
matrix:
runner: [ubuntu-24.04, macos-13, macos-14, windows-2022]
cc: ["gcc", "clang"]
codegen: ["amd64", "c", "llvm"]
exclude:
- runner: macos-13
include:
- runner: "ubuntu-24.04"
cc: "gcc"
- runner: macos-14
codegen: "amd64"
- runner: "ubuntu-24.04"
cc: "gcc"
codegen: "c"
- runner: "ubuntu-24.04"
cc: "clang"
codegen: "amd64"
- runner: "ubuntu-24.04"
cc: "clang"
codegen: "c"
- runner: "ubuntu-24.04"
cc: "clang"
codegen: "llvm"

- runner: "macos-13"
cc: "clang"
codegen: "amd64"
- runner: "macos-13"
cc: "clang"
codegen: "c"
- runner: "macos-13"
cc: "clang"
codegen: "llvm"

- runner: "macos-14"
cc: "clang"
codegen: "c"
- runner: "macos-14"
cc: "clang"
codegen: "llvm"

- runner: windows-2022
msystem: mingw64
cc: "gcc"
- runner: macos-14
codegen: "amd64"
- runner: windows-2022
msystem: mingw64
cc: "gcc"
codegen: "c"

- runner: windows-2022
msystem: ucrt64
cc: "gcc"
codegen: "amd64"
- runner: windows-2022
msystem: ucrt64
cc: "gcc"
codegen: "c"

- runner: windows-2022
msystem: clang64
cc: "clang"
codegen: "amd64"
- runner: windows-2022
codegen: "llvm"
- cc: "gcc"
msystem: clang64
cc: "clang"
codegen: "c"
- runner: windows-2022
msystem: clang64
cc: "clang"
codegen: "llvm"

runs-on: ${{ matrix.runner }}
Expand All @@ -43,7 +91,7 @@ jobs:
if: ${{ startsWith(matrix.runner, 'windows') }}
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
msystem: ${{ matrix.msystem }}
update: false
install: >-
base-devel
Expand Down Expand Up @@ -102,11 +150,11 @@ jobs:
$( if [[ -n "$WITH_GMP_DIR" ]]; then echo "WITH_GMP_DIR=$WITH_GMP_DIR"; fi ) \
WITH_ALL_RUNTIME=true \
WITH_DBG_RUNTIME=false \
MLTON_BINARY_RELEASE_SUFFIX=".${{ matrix.runner }}_${{ matrix.cc }}_${{ matrix.codegen }}" \
MLTON_BINARY_RELEASE_SUFFIX=".${{ matrix.runner }}${{ matrix.msystem && format('_msys2_{0}', matrix.msystem) || '' }}_${{ matrix.cc }}_${{ matrix.codegen }}" \
binary-release
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: mlton.${{ matrix.runner }}_${{ matrix.cc }}_${{ matrix.codegen }}
name: mlton.${{ matrix.runner }}${{ matrix.msystem && format('_msys2_{0}', matrix.msystem) || '' }}_${{ matrix.cc }}_${{ matrix.codegen }}
path: ./*.tgz

0 comments on commit ae18adc

Please sign in to comment.