Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/actions/setup-moonbit/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Setup MoonBit
description: Install the repository's pinned MoonBit toolchain

inputs:
version:
description: MoonBit toolchain version
required: false
# v0.10.7 ICEs while compiling moonbitlang/x@0.4.43. Keep CI on the
# last verified compiler until an upstream release fixes that regression.
default: "0.10.6+80dc50f24"

runs:
using: composite
steps:
- name: Install MoonBit CLI (Unix)
if: runner.os != 'Windows'
shell: bash
env:
MOONBIT_INSTALL_VERSION: ${{ inputs.version }}
run: |
set -euo pipefail
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> "$GITHUB_PATH"

- name: Install MoonBit CLI (Windows)
if: runner.os == 'Windows'
shell: pwsh
env:
MOONBIT_INSTALL_VERSION: ${{ inputs.version }}
run: |
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
irm https://cli.moonbitlang.com/install/powershell.ps1 | iex
echo "$env:USERPROFILE\.moon\bin" |
Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Report MoonBit version (Unix)
if: runner.os != 'Windows'
shell: bash
run: moon version --all

- name: Report MoonBit version (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: moon version --all
16 changes: 4 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ jobs:
version: 0.4.1
pkl-version: none
- name: Install MoonBit CLI
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> "$GITHUB_PATH"
uses: ./.github/actions/setup-moonbit
- name: Moon update
run: moon update
- name: pkf run check
Expand Down Expand Up @@ -182,9 +180,7 @@ jobs:
version: 0.4.1
pkl-version: none
- name: Install MoonBit CLI
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> "$GITHUB_PATH"
uses: ./.github/actions/setup-moonbit
- name: Moon update
run: moon update
- name: Build native binary for wbtests
Expand Down Expand Up @@ -236,9 +232,7 @@ jobs:
with:
submodules: true
- name: Install MoonBit CLI
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> "$GITHUB_PATH"
uses: ./.github/actions/setup-moonbit
- name: Moon update
run: moon update
- name: Distributed tests
Expand Down Expand Up @@ -312,9 +306,7 @@ jobs:

- name: Install MoonBit CLI
if: steps.shardtests.outputs.count != '0'
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> "$GITHUB_PATH"
uses: ./.github/actions/setup-moonbit

- name: Moon update
if: steps.shardtests.outputs.count != '0'
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ jobs:
uses: actions/checkout@v5

- name: Set up MoonBit
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> $GITHUB_PATH
uses: ./.github/actions/setup-moonbit

- name: Update MoonBit dependencies
run: |
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/git-compat-random.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ jobs:

- name: Install MoonBit CLI
if: ${{ steps.shard_guard.outputs.should_run == 'true' }}
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> "$GITHUB_PATH"
uses: ./.github/actions/setup-moonbit

- name: Build git from source
if: ${{ steps.shard_guard.outputs.should_run == 'true' }}
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/js-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ jobs:
bun-version: 1.3.5

- name: Install MoonBit CLI
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> "$GITHUB_PATH"
uses: ./.github/actions/setup-moonbit

- name: Moon update
run: moon update
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/pages-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ jobs:
bun-version: 1.3.5

- name: Install MoonBit CLI
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> "$GITHUB_PATH"
uses: ./.github/actions/setup-moonbit

- name: Moon update
run: moon update
Expand Down
15 changes: 2 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,8 @@ jobs:
with:
submodules: true

- name: Install MoonBit CLI (Unix)
if: runner.os != 'Windows'
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> "$GITHUB_PATH"

- name: Install MoonBit CLI (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
irm https://cli.moonbitlang.com/install/powershell.ps1 | iex
echo "$env:USERPROFILE\.moon\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install MoonBit CLI
uses: ./.github/actions/setup-moonbit

- name: Moon update
run: moon update
Expand Down
Loading