Skip to content

ci: setup ci #2

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

Merged
merged 2 commits into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: CI

on:
workflow_dispatch:
pull_request:
paths-ignore:
- '**/*.md'
push:
branches:
- main
paths-ignore:
- '**/*.md'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

jobs:
check:
name: Check
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
- os: ubuntu-latest
- os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- uses: Swatinem/rust-cache@v2
with:
shared-key: ci
save-if: ${{ github.ref_name == 'main' }}

- run: rustup show

- name: Cargo Check
shell: bash
run: |
cargo check --all-targets --all-features --locked
cargo test --no-run --all-targets --all-features

format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- run: rustup show

- run: cargo fmt --all -- --check

lint:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: Swatinem/rust-cache@v2
with:
shared-key: ci
save-if: false

- run: rustup show

- run: cargo clippy -- -D warnings

test:
name: Test
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
- os: ubuntu-latest
- os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- uses: Swatinem/rust-cache@v2
with:
shared-key: ci
save-if: false

- run: rustup show

- run: cargo test
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/target
/Cargo.lock
90 changes: 90 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ fn main() {
build
.file("./deps/ada.cpp")
.include("./deps/ada.h")
.include("./deps/ada_c.h");
.include("./deps/ada_c.h")
.cpp(true);

let compile_target_os = env::var("CARGO_CFG_TARGET_OS").expect("CARGO_CFG_TARGET_OS");
let compile_target_env = env::var("CARGO_CFG_TARGET_ENV").expect("CARGO_CFG_TARGET_ENV");
Expand Down
3 changes: 3 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[toolchain]
channel = "stable"
profile = "default"