Skip to content

Update to latest serenity-next #833

Update to latest serenity-next

Update to latest serenity-next #833

Workflow file for this run

on: [push, pull_request]
name: CI
jobs:
test:
name: Test
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
name:
- MSRV
- stable
- beta
- nightly
- macOS
- Windows
- no features
include:
- name: MSRV
toolchain: 1.68.0
# don't do doctests because they rely on new features for brevity
command: cargo test --all-features --lib --tests
- name: beta
toolchain: beta
- name: nightly
toolchain: nightly
- name: macOS
os: macOS-latest
- name: Windows
os: windows-latest
- name: no features
# don't test examples because they need collector feature
command: cargo test --no-default-features --features serenity/rustls_backend --lib --tests
- name: all features + simd_json
command: cargo test --all-features --features serenity/simd_json --lib --tests --examples
rustflags: -C target-cpu=haswell # needed for simd_json
- name: native TLS
command: cargo test --all-features --features serenity/native_tls_backend --lib --tests --examples
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain || 'stable' }}
override: true
- run: ${{ matrix.command || 'cargo test --all-features' }}
env:
RUSTFLAGS: ${{ matrix.rustflags }}
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add clippy
- run: RUSTFLAGS="-C target-cpu=haswell" cargo clippy --all-features -- -D warnings
docs:
name: Build docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
override: true
# don't use --no-deps because then intra-doc links to the macro crate won't work
- run: cargo +nightly doc --all-features -Z rustdoc-scrape-examples
env:
RUSTFLAGS: -C target-cpu=haswell # for simd-json
RUSTDOCFLAGS: --cfg doc_nightly -D warnings
# If on develop branch (as opposed to PR or whatever), publish docs to github pages
- name: Move files
if: github.ref == 'refs/heads/develop'
shell: bash
run: |
DIR=${GITHUB_REF#refs/heads/}
mkdir -p ./docs/$DIR
mv ./target/doc/* ./docs/$DIR/
- name: Deploy docs
if: github.ref == 'refs/heads/develop'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./docs
allow_empty_commit: false
keep_files: true