add workflow for interpreter CI and a Makefile for the interpreter #1
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
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 |