Skip to content

Commit

Permalink
add a build and test CI file, only with native compilations
Browse files Browse the repository at this point in the history
  • Loading branch information
danilopedraza committed Jan 23, 2025
1 parent f9bef67 commit d1101a2
Showing 1 changed file with 109 additions and 0 deletions.
109 changes: 109 additions & 0 deletions .github/workflows/core-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
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

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-apple-darwin
- aarch64-apple-darwin
- x86_64-pc-windows-gnu
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
cargo-tool: cargo
- os: macos-13 # intel
target: x86_64-apple-darwin
cargo-tool: cargo
- os: macos-latest # aarch64
target: aarch64-apple-darwin
cargo-tool: cargo
- os: windows-latest
target: x86_64-pc-windows-gnu
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:
working-directory: ./core
command: test
args: "--target ${{ matrix.target }}"
tool: ${{ matrix.cargo-tool }}

format:
name: format
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

- name: Check formatting
working-directory: ./core
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
working-directory: ./core
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
working-directory: ./core
run: make build

0 comments on commit d1101a2

Please sign in to comment.