Skip to content

Commit

Permalink
add workflow for interpreter CI and a Makefile for the interpreter
Browse files Browse the repository at this point in the history
  • Loading branch information
danilopedraza committed Jan 22, 2025
1 parent fbf42a8 commit 5a9bdb9
Show file tree
Hide file tree
Showing 2 changed files with 143 additions and 0 deletions.
127 changes: 127 additions & 0 deletions .github/workflows/core_ci.yml
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
16 changes: 16 additions & 0 deletions core/Makefile
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

0 comments on commit 5a9bdb9

Please sign in to comment.