Compare commits

..

13 Commits

Author SHA1 Message Date
kozabrada123 eba550551a
Merge e8469c8e4f into cb3551dcd4 2024-07-24 14:24:29 +00:00
Flori e8469c8e4f
Use cargo nextest (#529)
This PR switches the `linux` job from `cargo test` to `cargo nextest
run` for > 50% time reduction in the test execution step of the CI
pipeline. Also, the "check common non default feature configurations"
step has been moved from the `linux` job to it's own job, to parallelize
the CI pipeline further and reduce the time that CI needs to run to
completion.
2024-07-24 16:24:26 +02:00
bitfl0wer d15dfc302d
Revert: nextest on wasm 2024-07-24 16:17:00 +02:00
bitfl0wer 31509b9945
forgor installing nextest 2024-07-24 16:12:06 +02:00
bitfl0wer f32b3060cf
Cargo nextest on wasm, Parallelize "Check common non-default feat. cfg." 2024-07-24 16:09:33 +02:00
bitfl0wer cc7ed62cf2
Merge branch 'dev' into nextest 2024-07-24 15:59:21 +02:00
bitfl0wer 7bb35e5ed8
Increase limit integer size to match spacebars' possibilities 2024-07-24 15:57:12 +02:00
bitfl0wer f0fc6eab4d
Fix testcase that relied on false behavior implemented by older spacebar servers 2024-07-24 15:55:49 +02:00
bitfl0wer dd85a7de17
Fix/Correct UnavailableGuild object 2024-07-24 15:55:29 +02:00
bitfl0wer 6bc6651e80
Remove redundant "build" step
I mean the bloody thing already gets built with "cargo test", so...
2024-07-24 14:06:10 +02:00
bitfl0wer 0bfab58f2f
Use cargo nextest 2024-07-24 14:00:40 +02:00
bitfl0wer 6cd3c1081b
Use cargo nextest 2024-07-24 13:58:19 +02:00
bitfl0wer 7a2666bde2
Update CONTRIBUTING.md 2024-07-24 13:37:07 +02:00
5 changed files with 118 additions and 140 deletions

View File

@ -2,19 +2,17 @@ name: Build and Test
on: on:
push: push:
branches: [ "main" ] branches: ["main"]
pull_request: pull_request:
branches: [ "main", "dev" ] branches: ["main", "dev"]
env: env:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
jobs: jobs:
linux: linux:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 30 timeout-minutes: 30
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Clone spacebar server - name: Clone spacebar server
@ -23,7 +21,7 @@ jobs:
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version: 18 node-version: 18
cache: 'npm' cache: "npm"
cache-dependency-path: server/package-lock.json cache-dependency-path: server/package-lock.json
- name: Prepare and start Spacebar server - name: Prepare and start Spacebar server
run: | run: |
@ -35,17 +33,27 @@ jobs:
with: with:
cache-all-crates: "true" cache-all-crates: "true"
prefix-key: "linux" prefix-key: "linux"
- name: Build, Test and Publish Coverage - uses: taiki-e/install-action@nextest
- name: Build, Test with nextest, Publish Coverage
run: | run: |
if [ -n "${{ secrets.COVERALLS_REPO_TOKEN }}" ]; then if [ -n "${{ secrets.COVERALLS_REPO_TOKEN }}" ]; then
if [ "${{github.event.pull_request.head.ref}}" = "main" ]; then
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
cargo binstall --no-confirm cargo-tarpaulin --force cargo binstall --no-confirm cargo-tarpaulin --force
cargo tarpaulin --all-features --avoid-cfg-tarpaulin --tests --verbose --skip-clean --coveralls ${{ secrets.COVERALLS_REPO_TOKEN }} --timeout 120 cargo tarpaulin --all-features --avoid-cfg-tarpaulin --tests --verbose --skip-clean --coveralls ${{ secrets.COVERALLS_REPO_TOKEN }} --timeout 120
else else
echo "Code Coverage step is skipped on forks!" echo "Code Coverage step is skipped on non-main PRs and PRs from forks."
cargo build --verbose --all-features cargo nextest run --verbose --all-features
cargo test --verbose --all-features
fi fi
else
echo "Code Coverage step is skipped on non-main PRs and PRs from forks."
cargo nextest run --verbose --all-features
fi
linux-non-default-features:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Check common non-default feature configurations - name: Check common non-default feature configurations
run: | run: |
echo "No features:" echo "No features:"
@ -66,34 +74,6 @@ jobs:
cargo check --features="backend, voice_gateway" --no-default-features cargo check --features="backend, voice_gateway" --no-default-features
echo "Client + voice gateway:" echo "Client + voice gateway:"
cargo check --features="client, voice_gateway" --no-default-features cargo check --features="client, voice_gateway" --no-default-features
# wasm-safari:
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v4
# - name: Clone spacebar server
# run: |
# git clone https://github.com/bitfl0wer/server.git
# - uses: actions/setup-node@v4
# with:
# node-version: 18
# cache: 'npm'
# cache-dependency-path: server/package-lock.json
# - name: Prepare and start Spacebar server
# run: |
# npm install
# npm run setup
# npm run start &
# working-directory: ./server
# - uses: Swatinem/rust-cache@v2
# with:
# cache-all-crates: "true"
# prefix-key: "macos-safari"
# - name: Run WASM tests with Safari, Firefox, Chrome
# run: |
# rustup target add wasm32-unknown-unknown
# curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
# cargo binstall --no-confirm wasm-bindgen-cli --version "0.2.88" --force
# SAFARIDRIVER=$(which safaridriver) cargo test --target wasm32-unknown-unknown --no-default-features --features="client, rt" --no-fail-fast
wasm-gecko: wasm-gecko:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 30 timeout-minutes: 30
@ -105,7 +85,7 @@ jobs:
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version: 18 node-version: 18
cache: 'npm' cache: "npm"
cache-dependency-path: server/package-lock.json cache-dependency-path: server/package-lock.json
- name: Prepare and start Spacebar server - name: Prepare and start Spacebar server
run: | run: |
@ -134,7 +114,7 @@ jobs:
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version: 18 node-version: 18
cache: 'npm' cache: "npm"
cache-dependency-path: server/package-lock.json cache-dependency-path: server/package-lock.json
- name: Prepare and start Spacebar server - name: Prepare and start Spacebar server
run: | run: |

View File

@ -3,6 +3,8 @@
**Please refer to the [contribution guidelines](https://github.com/polyphony-chat/.github/blob/main/CONTRIBUTION_GUIDELINES.md) and [our Code of Conduct](https://github.com/polyphony-chat/.github/blob/main/CODE_OF_CONDUCT.md) before making a contribution.** **Please refer to the [contribution guidelines](https://github.com/polyphony-chat/.github/blob/main/CONTRIBUTION_GUIDELINES.md) and [our Code of Conduct](https://github.com/polyphony-chat/.github/blob/main/CODE_OF_CONDUCT.md) before making a contribution.**
Contributions should always fork from and merge back into the `dev` branch.
Chorus is currently missing voice support and a lot of API endpoints, many of which should be trivial to implement, Chorus is currently missing voice support and a lot of API endpoints, many of which should be trivial to implement,
ever since [we streamlined the process of doing so](https://github.com/polyphony-chat/chorus/discussions/401). ever since [we streamlined the process of doing so](https://github.com/polyphony-chat/chorus/discussions/401).

View File

@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Copy, PartialOrd, Ord, Hash)] #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Copy, PartialOrd, Ord, Hash)]
pub struct GlobalRateLimit { pub struct GlobalRateLimit {
pub limit: u16, pub limit: u64,
pub window: u64, pub window: u64,
pub enabled: bool, pub enabled: bool,
} }

View File

@ -240,13 +240,18 @@ impl PartialEq for GuildInvite {
} }
} }
#[derive(Serialize, Deserialize, Debug, Default, Clone, PartialEq, Hash, Eq, PartialOrd, Ord, Copy)] #[derive(
Serialize, Deserialize, Debug, Default, Clone, PartialEq, Hash, Eq, PartialOrd, Ord, Copy,
)]
pub struct UnavailableGuild { pub struct UnavailableGuild {
pub id: Snowflake, pub id: Snowflake,
pub unavailable: bool, pub unavailable: Option<bool>,
pub geo_restricted: Option<bool>,
} }
#[derive(Serialize, Deserialize, Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Copy)] #[derive(
Serialize, Deserialize, Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Copy,
)]
pub struct GuildCreateResponse { pub struct GuildCreateResponse {
pub id: Snowflake, pub id: Snowflake,
} }

View File

@ -70,15 +70,6 @@ async fn guild_create_ban() {
) )
.await .await
.unwrap(); .unwrap();
assert!(Guild::create_ban(
guild.id,
other_user_id,
None,
GuildBanCreateSchema::default(),
&mut bundle.user,
)
.await
.is_err());
common::teardown(bundle).await common::teardown(bundle).await
} }