From a6c58ae2ac2db4d72ceef92557cb520c8a8c61b1 Mon Sep 17 00:00:00 2001 From: Zihang Ye Date: Fri, 12 Dec 2025 11:02:24 +0800 Subject: [PATCH] ci: Refactor CI workflow for MoonBit CLI installation --- .github/workflows/check.yaml | 75 +++++++++++++++++------------------- 1 file changed, 35 insertions(+), 40 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 16ea1e7..391577b 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -17,43 +17,42 @@ jobs: check: strategy: matrix: - version: [stable,pre-release,bleeding] os: - - name: ubuntu-latest - triple: x86_64-linux-gnu - - name: macos-latest - triple: arm64-apple-darwin - - name: macos-13 - triple: x86_64-apple-darwin - - name: windows-latest - triple: x86_64-w64-mingw32 - - # stable check - - # pre-release check - - # bleeding check - # 1. install latest toolchain - # 2. install latest core library from github.com - + - ubuntu-latest + - macos-latest + - windows-latest + version: + - latest + - nightly fail-fast: false - runs-on: ${{ matrix.os.name }} - continue-on-error: false + runs-on: ${{ matrix.os }} + continue-on-error: ${{ matrix.version == 'nightly' }} steps: - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - - name: Setup Moon - uses: illusory0x0/setup-moonbit@v0.1.0 - with: - version: ${{ matrix.version }} - - name: moon version + - name: Install MoonBit CLI on *nix + if: runner.os != 'Windows' + shell: bash + run: | + curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash -s "${{ matrix.version }}" + echo "$HOME/.moon/bin" >> $GITHUB_PATH + + - name: Install MoonBit CLI on Windows + if: runner.os == 'Windows' + shell: powershell + env: + MOONBIT_INSTALL_VERSION: ${{ matrix.version }} + run: | + Set-ExecutionPolicy RemoteSigned -Scope CurrentUser; irm https://cli.moonbitlang.com/install/powershell.ps1 | iex + "C:\Users\runneradmin\.moon\bin" | Out-File -FilePath $env:GITHUB_PATH -Append + + - name: Verify installation + shell: bash run: | moon version --all - - - name: install module dependencies + + - name: Update Registry + shell: bash run: | moon update moon install @@ -63,7 +62,7 @@ jobs: - name: moon info run: | - moon info --target wasm,wasm-gc,js,native + moon info --target all git diff --exit-code - name: format diff @@ -72,22 +71,18 @@ jobs: git diff --exit-code - name: Setup MSVC - if: ${{ matrix.os.name == 'windows-latest' }} + if: ${{ runner.os == 'Windows' }} uses: ilammy/msvc-dev-cmd@v1 - name: Set ulimit on unix - if: ${{ matrix.os.name != 'windows-latest' }} + if: ${{ runner.os != 'Windows' }} run: | ulimit -s 8176 - name: moon test run: | - moon test --target all,native - moon test --target all,native --release - - - name: moon test --doc - run: | - moon test --doc + moon test --target all + moon test --target all --release moon-json-format-check: runs-on: ubuntu-latest @@ -128,4 +123,4 @@ jobs: uses: huacnlee/autocorrect-action@v2 - name: typos-action - uses: crate-ci/typos@v1.31.1 \ No newline at end of file + uses: crate-ci/typos@v1.31.1