Skip to content

Commit

Permalink
Clean up CI config
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jan 8, 2022
1 parent 68977d8 commit 1831256
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 97 deletions.
1 change: 1 addition & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
msrv = "1.34"
57 changes: 0 additions & 57 deletions .github/workflows/build-and-test.yaml

This file was deleted.

82 changes: 82 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: CI

on:
pull_request:
push:
branches:
- master
schedule:
- cron: '0 2 * * *'

env:
RUSTFLAGS: -D warnings
RUST_BACKTRACE: 1

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
rust: [nightly, beta, stable]
steps:
- uses: actions/checkout@v2
- name: Install Rust
# --no-self-update is necessary because the windows environment cannot self-update rustup.exe.
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
- name: Install wasm test tools
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
if: startsWith(matrix.os, 'ubuntu')
- name: Run cargo check
run: cargo check --all --all-features --all-targets
if: startsWith(matrix.rust, 'nightly')
- name: Run cargo check (without dev-dependencies to catch missing feature flags)
if: startsWith(matrix.rust, 'nightly')
run: cargo check -Z features=dev_dep
- run: cargo test
- name: Test wasm
run: wasm-pack test --headless --chrome
if: startsWith(matrix.os, 'ubuntu')
- run: cargo bench
if: startsWith(matrix.rust, 'nightly')

msrv:
runs-on: ubuntu-latest
strategy:
matrix:
# When updating this, the reminder to update the minimum supported
# Rust version in Cargo.toml and .clippy.toml.
rust: ['1.34']
steps:
- uses: actions/checkout@v2
- name: Install Rust
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
- run: cargo build

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
run: rustup update stable
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features -- -W clippy::all

fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
run: rustup update stable
- run: cargo fmt --all -- --check

security_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
23 changes: 0 additions & 23 deletions .github/workflows/lint.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/security.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ name = "fastrand"
version = "1.6.0"
authors = ["Stjepan Glavina <stjepang@gmail.com>"]
edition = "2018"
rust-version = "1.34"
description = "A simple and fast random number generator"
license = "Apache-2.0 OR MIT"
repository = "https://github.com/smol-rs/fastrand"
homepage = "https://github.com/smol-rs/fastrand"
keywords = ["simple", "fast", "rand", "random", "wyrand"]
categories = ["algorithms"]
exclude = ["/.*"]

[target.'cfg(target_arch = "wasm32")'.dependencies]
instant = "0.1"
Expand Down

0 comments on commit 1831256

Please sign in to comment.