diff --git a/.github/actions/install-deps/action.yml b/.github/actions/install-deps/action.yml new file mode 100644 index 000000000..aaab13d8d --- /dev/null +++ b/.github/actions/install-deps/action.yml @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c5cb0525..6e7a89c81 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} @@ -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: |