Skip to content

Replace Vec and String with FixedArray and FixedString for all models #4657

Replace Vec and String with FixedArray and FixedString for all models

Replace Vec and String with FixedArray and FixedString for all models #4657

Workflow file for this run

name: CI
on: [push, pull_request]
env:
rust_min: 1.74.0
rust_nightly: nightly-2023-11-16
jobs:
test:
name: Test
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
name:
- stable
- beta
# The build matrix doesn't support the `env` variable in expressions
# see: jobs.nightly
# - nightly
- Windows
- native-tls
- no default features
- no cache
- no gateway
- unstable Discord API features
- simd-json
include:
- name: beta
toolchain: beta
- name: Windows
os: windows-latest
- name: native-tls
features: default_native_tls
- name: no default features
features: " "
- name: no cache
features: builder client framework gateway model http standard_framework utils rustls_backend
- name: simd-json
features: default_no_backend rustls_backend simd_json
- name: no gateway
features: model http rustls_backend
- name: chrono
features: chrono
- name: unstable API + typesize
features: default unstable_discord_api typesize
dont-test: true
- name: builder without model
features: builder
dont-test: true
- name: unstable Discord API (no default features)
features: unstable_discord_api
dont-test: true
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain || 'stable' }}
- name: Add problem matchers
shell: bash
run: echo "::add-matcher::.github/matchers/rust.json"
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Build all features
if: matrix.features == ''
run: cargo build --features full
- name: Test all features
if: matrix.features == ''
run: cargo test --features full
- name: Build some features
if: matrix.features
run: cargo build --no-default-features --features "${{ matrix.features }}"
- name: Test some features
if: ${{ !matrix.dont-test && matrix.features }}
run: cargo test --no-default-features --features "${{ matrix.features }}"
nightly:
name: Test (nightly)
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install toolchain (${{ env.rust_nightly }})
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_nightly }}
- name: Add problem matchers
shell: bash
run: echo "::add-matcher::.github/matchers/rust.json"
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Build all features
run: cargo build --features full
- name: Test all features
run: cargo test --features full
macOS:
name: Test (macOS)
runs-on: macos-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
- name: Add problem matchers
shell: bash
run: echo "::add-matcher::.github/matchers/rust.json"
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Remove cargo build config
run: rm .cargo/config.toml
- name: Build
run: cargo build
- name: Test
run: cargo test
MSRV:
runs-on: ubuntu-latest
# We only run this job on the current branch as keeping MSRV the same is not important on next.
if: (github.event_name == 'push' && github.ref_name == 'current') ||
(github.event_name == 'pull_request' && github.base_ref == 'current')
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install toolchain (${{ env.rust_min }})
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_min }}
- name: Add problem matchers
run: echo "::add-matcher::.github/matchers/rust.json"
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Check
run: cargo check --features full
min_versions:
name: Check minimal versions
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install toolchain (${{ env.rust_nightly }})
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_nightly }}
- name: Add problem matchers
run: echo "::add-matcher::.github/matchers/rust.json"
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Check minimal versions
run: |
cargo update -Z minimal-versions
cargo check
doc:
name: Build docs
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install toolchain (${{ env.rust_nightly }})
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_nightly }}
- name: Add problem matchers
run: echo "::add-matcher::.github/matchers/rust.json"
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Build docs
run: |
cargo doc --no-deps --features collector,voice,unstable_discord_api
cargo doc --no-deps -p command_attr
env:
RUSTDOCFLAGS: -D rustdoc::broken_intra_doc_links
examples:
name: Examples
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
- name: Add problem matchers
run: echo "::add-matcher::.github/matchers/rust.json"
- name: Cache
uses: Swatinem/rust-cache@v2
- name: 'Check example 1'
run: cargo check -p e01_basic_ping_bot
- name: 'Check example 2'
run: cargo check -p e02_transparent_guild_sharding
- name: 'Check example 3'
run: cargo check -p e03_struct_utilities
- name: 'Check example 4'
run: cargo check -p e04_message_builder
- name: 'Check example 5'
run: cargo check -p e05_command_framework
- name: 'Check example 6'
run: cargo check -p e06_sample_bot_structure
- name: 'Check example 7'
run: cargo check -p e07_env_logging
- name: 'Check example 8'
run: cargo check -p e08_shard_manager
- name: 'Check example 9'
run: cargo check -p e09_create_message_builder
- name: 'Check example 10'
run: cargo check -p e10_collectors
- name: 'Check example 11'
run: cargo check -p e11_gateway_intents
- name: 'Check example 12'
run: cargo check -p e12_global_data
- name: 'Check example 13'
run: cargo check -p e13_parallel_loops
- name: 'Check example 14'
run: cargo check -p e14_slash_commands
- name: 'Check example 15'
run: cargo check -p e15_simple_dashboard
- name: 'Check example 16'
run: cargo check -p e16_sqlite_database
- name: 'Check example 17'
run: cargo check -p e17_message_components
- name: 'Check example 18'
run: cargo check -p e18_webhook
- name: 'Check example 19'
run: cargo check -p e19_interactions_endpoint