Skip to content

Add CI #5

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 5, 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
54 changes: 54 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
on:
push:
branches: [main, release]
pull_request:
types: [opened, synchronize, reopened]
merge_group:

name: CI

# Cancel previous workflows if they are the same workflow on same ref (branch/tags)
# with the same event (push/pull_request) even they are in progress.
# This setting will help reduce the number of duplicated workflows.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true

env:
CARGO_ARGS: --no-default-features --features stdlib,zlib,importlib,encodings,ssl,jit

jobs:
rust_tests:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
env:
RUST_BACKTRACE: full
name: Run rust tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Set up the Mac environment
run: brew install autoconf automake libtool
if: runner.os == 'macOS'

- uses: Swatinem/rust-cache@v2

- name: run tests
run: cargo test --all --all-features

lint:
name: Check Rust code with rustfmt and clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: run rustfmt
run: cargo fmt --all -- --check
- name: run clippy
run: cargo clippy --all --all-features -- -Dwarnings
22 changes: 0 additions & 22 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,19 @@ members = [
ahash = "0.7.6"
anyhow = "1.0.45"
ascii = "1.0"
atty = "0.2.14"
bincode = "1.3.3"
bitflags = "1.3.2"
bstr = "0.2.17"
cfg-if = "1.0"
chrono = "0.4.19"
crossbeam-utils = "0.8.9"
flame = "0.2.2"
glob = "0.3"
hex = "0.4.3"
indexmap = "1.8.1"
insta = "1.14.0"
itertools = "0.10.3"
libc = "0.2.133"
log = "0.4.16"
nix = "0.26"
num-complex = "0.4.0"
num-bigint = "0.4.3"
num-integer = "0.1.44"
num-rational = "0.4.0"
num-traits = "0.2"
num_enum = "0.5.7"
once_cell = "1.13"
parking_lot = "0.12"
paste = "1.0.7"
rand = "0.8.5"
rustyline = "11"
serde = "1.0"
schannel = "0.1.19"
static_assertions = "1.1"
syn = "1.0.91"
thiserror = "1.0"
thread_local = "1.1.4"
unicode_names2 = { version = "0.6.0", git = "https://github.com/youknowone/unicode_names2.git", rev = "4ce16aa85cbcdd9cc830410f1a72ef9a235f2fde" }
widestring = "0.5.1"

[profile.dev.package."*"]
opt-level = 3
Expand Down