-
Notifications
You must be signed in to change notification settings - Fork 3
Adding Windows OS support #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
chethanuk
wants to merge
10
commits into
golemcloud:main
Choose a base branch
from
chethanuk:support-windows-os
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5f031bb
Adding windows os in ci
chethanuk 615cfb3
Adding support for windows os
chethanuk f95a150
Clippy fixes
chethanuk 062c0ee
Update ci.yaml
chethanuk 7591dba
Fix the tests and update moonc
chethanuk 6686c22
Fix the tests and update moonc
chethanuk 985a207
Fix clippy:
chethanuk 9244dc3
Merge branch 'main' into windows-ci
chethanuk e0743a4
Fix clippy locally
chethanuk 8dedc8a
FIx moonc for windows os error 87 - draft
chethanuk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[build] | ||
jobs = 8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,64 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
permissions: | ||
checks: write | ||
pull-requests: write | ||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
prefix-key: v1-rust | ||
prefix-key: v1-rust-${{ matrix.os }} | ||
shared-key: debug | ||
cache-all-crates: true | ||
timeout-minutes: 10 | ||
- name: Setup Rust | ||
uses: actions-rs/toolchain@v1 | ||
if: runner.os != 'Windows' | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
override: true | ||
- name: Install moonbit | ||
components: rustfmt, clippy | ||
- name: Setup Rust | ||
if: runner.os == 'Windows' | ||
run: | | ||
rustup toolchain install stable --profile default --no-self-update | ||
rustup default stable | ||
rustup component add rustfmt clippy | ||
rustup target add wasm32-wasip1 | ||
- name: Install moonbit (Unix) | ||
if: runner.os != 'Windows' | ||
run: | | ||
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash -s -- 0.6.19 | ||
echo "$HOME/.moon/bin" >> $GITHUB_PATH | ||
- name: Install moonbit (Windows) | ||
if: runner.os == 'Windows' | ||
shell: powershell | ||
run: | | ||
$env:MOONBIT_INSTALL_VERSION = "0.6.19" | ||
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force | ||
$ProgressPreference = 'SilentlyContinue' | ||
try { | ||
$script = Invoke-RestMethod -Uri "https://cli.moonbitlang.com/install/powershell.ps1" -TimeoutSec 120 | ||
Invoke-Expression $script | ||
} catch { | ||
Write-Error "Failed to download or execute MoonBit installer: $_" | ||
exit 1 | ||
} | ||
echo "$env:USERPROFILE\.moon\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | ||
- name: Bundle core MoonBit library | ||
run: moon bundle --target wasm | ||
working-directory: core | ||
|
@@ -46,28 +70,55 @@ jobs: | |
run: cargo build --all-features --all-targets | ||
test: | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
prefix-key: v1-rust | ||
prefix-key: v1-rust-${{ matrix.os }} | ||
shared-key: debug | ||
cache-all-crates: false | ||
timeout-minutes: 10 | ||
- name: Setup Rust | ||
uses: actions-rs/toolchain@v1 | ||
if: runner.os != 'Windows' | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
override: true | ||
components: rustfmt, clippy | ||
- name: Setup Rust | ||
if: runner.os == 'Windows' | ||
run: | | ||
rustup toolchain install stable --profile default --no-self-update | ||
rustup default stable | ||
rustup component add rustfmt clippy | ||
rustup target add wasm32-wasip1 | ||
- uses: cargo-bins/cargo-binstall@main | ||
- name: Install wasmtime-cli | ||
run: cargo binstall --force --locked [email protected] | ||
- name: Install moonbit | ||
- name: Install moonbit (Unix) | ||
if: runner.os != 'Windows' | ||
run: | | ||
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash -s -- 0.6.19 | ||
echo "$HOME/.moon/bin" >> $GITHUB_PATH | ||
- name: Install moonbit (Windows) | ||
if: runner.os == 'Windows' | ||
shell: powershell | ||
run: | | ||
$env:MOONBIT_INSTALL_VERSION = "0.6.19" | ||
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force | ||
$ProgressPreference = 'SilentlyContinue' | ||
try { | ||
$script = Invoke-RestMethod -Uri "https://cli.moonbitlang.com/install/powershell.ps1" -TimeoutSec 120 | ||
Invoke-Expression $script | ||
} catch { | ||
Write-Error "Failed to download or execute MoonBit installer: $_" | ||
exit 1 | ||
} | ||
echo "$env:USERPROFILE\.moon\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | ||
- name: Bundle core MoonBit library | ||
run: moon bundle --target wasm | ||
working-directory: core | ||
|
@@ -83,7 +134,7 @@ jobs: | |
publish: | ||
needs: [test] | ||
if: "startsWith(github.ref, 'refs/tags/v')" | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-latest # Publish on Ubuntu only | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The library's purpose is to embed the moonbit compiler in a way that the users don't have to install it separately (it contains a version of it compiled to WASM, executed on V8). So the CI definitely should not install the moonbit compiler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I realized it's needed for bundling the core library.