Skip to content

Commit

Permalink
Extract Install dependencies composite action
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewFluet committed Dec 20, 2024
1 parent 665812b commit 1d05a9a
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 72 deletions.
71 changes: 71 additions & 0 deletions .github/actions/install-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: 'Install dependencies'
description: 'Install dependencies to bootstrap MLton'
defaults:
run:
runs:
using: "composite"
steps:
- name: Check
shell: 'bash'
run: echo "${{ matrix.runner }}"

- name: Install dependencies (ubuntu)
if: ${{ startsWith(runner, 'ubuntu') }}
shell: 'bash'
run: |
sudo apt-get update
sudo apt-get install libgmp-dev
if [[ "${{ matrix.codegen }}" == "llvm" ]]; 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'
mv mlton-20210117-1.amd64-linux-glibc2.31/* .
rmdir mlton-20210117-1.amd64-linux-glibc2.31
- name: Install dependencies (macos (amd64))
if: ${{ runner == 'macos-13' }}
shell: 'bash'
run: |
# brew update
brew install -q gmp
echo "WITH_GMP_DIR=/usr/local" >> $GITHUB_ENV
if [[ "${{ matrix.codegen }}" == "llvm" ]]; 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'
mv mlton-20210117-1.amd64-darwin-19.6.gmp-homebrew/* .
rmdir mlton-20210117-1.amd64-darwin-19.6.gmp-homebrew
- name: Install dependencies (macos (arm64))
if: ${{ runner == 'macos-14' }}
shell: 'bash'
run: |
# brew update
brew install -q gmp
echo "WITH_GMP_DIR=/opt/homebrew" >> $GITHUB_ENV
if [[ "${{ matrix.codegen }}" == "llvm" ]]; 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'
mv mlton-20210117-1.arm64-darwin-21.6-gmp-static/* .
rmdir mlton-20210117-1.arm64-darwin-21.6-gmp-static
- name: Install msys2 (windows)
if: ${{ startsWith(runner, 'windows') }}
uses: msys2/setup-msys2@v2
with:
update: false
install: >-
base-devel
git
pactoys
- name: Install dependencies (windows)
if: ${{ startsWith(runner, 'windows') }}
shell: 'msys2 {0}'
run: |
pacboy --noconfirm -S --needed gcc:p gmp-devel:
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'
mv mlton-20200817-amd64-mingw/* .
rmdir mlton-20200817-amd64-mingw
94 changes: 22 additions & 72 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,26 @@ 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
cc: "gcc"
- runner: macos-14
cc: "gcc"
- runner: macos-14
codegen: "amd64"
- runner: windows-2022
cc: "clang"
- runner: windows-2022
codegen: "llvm"
- cc: "gcc"
codegen: "llvm"
runner: [ubuntu-24.04]
cc: ["gcc"]
codegen: ["amd64"]
# matrix:
# runner: [ubuntu-24.04, macos-13, macos-14, windows-2022]
# cc: ["gcc", "clang"]
# codegen: ["amd64", "c", "llvm"]
# exclude:
# - runner: macos-13
# cc: "gcc"
# - runner: macos-14
# cc: "gcc"
# - runner: macos-14
# codegen: "amd64"
# - runner: windows-2022
# cc: "clang"
# - runner: windows-2022
# codegen: "llvm"
# - cc: "gcc"
# codegen: "llvm"

# The type of runner that the job will run on
runs-on: ${{ matrix.runner }}
Expand All @@ -48,62 +52,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies (ubuntu)
if: ${{ startsWith(matrix.runner, 'ubuntu') }}
run: |
sudo apt-get update
sudo apt-get install libgmp-dev
if [[ "${{ matrix.codegen }}" == "llvm" ]]; 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'
mv mlton-20210117-1.amd64-linux-glibc2.31/* .
rmdir mlton-20210117-1.amd64-linux-glibc2.31
- name: Install dependencies (macos (amd64))
if: ${{ matrix.runner == 'macos-13' }}
run: |
# brew update
brew install -q gmp
echo "WITH_GMP_DIR=/usr/local" >> $GITHUB_ENV
if [[ "${{ matrix.codegen }}" == "llvm" ]]; 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'
mv mlton-20210117-1.amd64-darwin-19.6.gmp-homebrew/* .
rmdir mlton-20210117-1.amd64-darwin-19.6.gmp-homebrew
- name: Install dependencies (macos (arm64))
if: ${{ matrix.runner == 'macos-14' }}
run: |
# brew update
brew install -q gmp
echo "WITH_GMP_DIR=/opt/homebrew" >> $GITHUB_ENV
if [[ "${{ matrix.codegen }}" == "llvm" ]]; 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'
mv mlton-20210117-1.arm64-darwin-21.6-gmp-static/* .
rmdir mlton-20210117-1.arm64-darwin-21.6-gmp-static
- name: Install msys2 (windows)
if: ${{ startsWith(matrix.runner, 'windows') }}
uses: msys2/setup-msys2@v2
with:
update: false
install: >-
base-devel
git
pactoys
- name: Install dependencies (windows)
if: ${{ startsWith(matrix.runner, 'windows') }}
run: |
pacboy --noconfirm -S --needed gcc:p gmp-devel:
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'
mv mlton-20200817-amd64-mingw/* .
rmdir mlton-20200817-amd64-mingw
- name: Install dependencies
uses: ./.github/actions/install-deps

- name: Check versions
run: |
Expand Down

0 comments on commit 1d05a9a

Please sign in to comment.