-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add workflow for interpreter CI and a Makefile for the interpreter
- Loading branch information
1 parent
fbf42a8
commit 5a9bdb9
Showing
2 changed files
with
143 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,127 @@ | ||
name: ci | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
working-directory: ./core | ||
|
||
jobs: | ||
test: | ||
name: test | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 10 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
toolchain: [stable] | ||
target: | ||
- x86_64-unknown-linux-gnu | ||
- x86_64-unknown-linux-musl | ||
- aarch64-unknown-linux-gnu | ||
- aarch64-unknown-linux-musl | ||
- x86_64-apple-darwin | ||
- x86_64-pc-windows-msvc | ||
include: | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
binary: x86-64 | ||
cargo-tool: cargo | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-musl | ||
binary: x86-64 | ||
cargo-tool: cross | ||
- os: ubuntu-latest | ||
target: aarch64-unknown-linux-gnu | ||
binary: aarch64 | ||
cargo-tool: cross | ||
- os: ubuntu-latest | ||
target: aarch64-unknown-linux-musl | ||
binary: aarch64 | ||
cargo-tool: cross | ||
- os: macos-13 # intel | ||
target: x86_64-apple-darwin | ||
binary: x86_64 | ||
cargo-tool: cargo | ||
- os: macos-latest # aarch64 | ||
toolchain: stable | ||
target: aarch64-apple-darwin | ||
binary: arm64 | ||
cargo-tool: cargo | ||
- os: windows-latest | ||
target: x86_64-pc-windows-gnu | ||
binary: x86-64 | ||
cargo-tool: cargo | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
target: ${{ matrix.target }} | ||
|
||
- name: Run tests | ||
uses: clechasseur/rs-cargo@v3 | ||
with: | ||
command: test | ||
args: "--target ${{ matrix.target }}" | ||
tool: ${{ matrix.cargo-tool }} | ||
|
||
fmt: | ||
name: fmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
components: rustfmt | ||
|
||
- run: make fmt | ||
|
||
lint: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
components: clippy | ||
|
||
- name: Run linter | ||
run: make lint | ||
|
||
build: | ||
name: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
components: clippy | ||
|
||
- name: Build | ||
run: make build |
This file contains 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,16 @@ | ||
CURRENT_DIR = $(shell pwd) | ||
|
||
build: | ||
cargo build --all-features --release | ||
|
||
test: | ||
KOMODO_STD=$(CURRENT_DIR)/../std/ sh test.sh $(CURRENT_DIR)/../examples | ||
|
||
lint: | ||
cargo clippy --all-targets --all-features | ||
|
||
fmt: | ||
cargo fmt --check | ||
|
||
repl: | ||
KOMODO_STD=$(CURRENT_DIR)/../std/ cargo run --all-features --quiet |