Compare commits
1 Commits
88a160717a
...
f828727512
Author | SHA1 | Date |
---|---|---|
Flori | f828727512 |
|
@ -2,133 +2,153 @@ 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
|
||||||
run: |
|
run: |
|
||||||
git clone https://github.com/bitfl0wer/server.git
|
git clone https://github.com/bitfl0wer/server.git
|
||||||
- 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: |
|
||||||
npm install
|
npm install
|
||||||
npm run setup
|
npm run setup
|
||||||
npm run start &
|
npm run start &
|
||||||
working-directory: ./server
|
working-directory: ./server
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
cache-all-crates: "true"
|
cache-all-crates: "true"
|
||||||
prefix-key: "linux"
|
prefix-key: "linux"
|
||||||
- uses: taiki-e/install-action@nextest
|
- name: Build, Test and Publish Coverage
|
||||||
- name: Build, Test with nextest, Publish Coverage
|
run: |
|
||||||
run: |
|
if [ -n "${{ secrets.COVERALLS_REPO_TOKEN }}" ]; then
|
||||||
if [ -n "${{ secrets.COVERALLS_REPO_TOKEN }}" ]; then
|
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
||||||
if [ "${{github.event.pull_request.head.ref}}" = "main" ]; then
|
cargo binstall --no-confirm cargo-tarpaulin --force
|
||||||
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
cargo tarpaulin --all-features --avoid-cfg-tarpaulin --tests --verbose --skip-clean --coveralls ${{ secrets.COVERALLS_REPO_TOKEN }} --timeout 120
|
||||||
cargo binstall --no-confirm cargo-tarpaulin --force
|
else
|
||||||
cargo tarpaulin --all-features --avoid-cfg-tarpaulin --tests --verbose --skip-clean --coveralls ${{ secrets.COVERALLS_REPO_TOKEN }} --timeout 120
|
echo "Code Coverage step is skipped on forks!"
|
||||||
else
|
cargo build --verbose --all-features
|
||||||
echo "Code Coverage step is skipped on non-main PRs and PRs from forks."
|
cargo test --verbose --all-features
|
||||||
cargo nextest run --verbose --all-features
|
fi
|
||||||
fi
|
- name: Check common non-default feature configurations
|
||||||
else
|
run: |
|
||||||
echo "Code Coverage step is skipped on non-main PRs and PRs from forks."
|
echo "No features:"
|
||||||
cargo nextest run --verbose --all-features
|
cargo check --features="" --no-default-features
|
||||||
fi
|
echo "Only client:"
|
||||||
linux-non-default-features:
|
cargo check --features="client" --no-default-features
|
||||||
runs-on: ubuntu-latest
|
echo "Only backend:"
|
||||||
timeout-minutes: 10
|
cargo check --features="backend" --no-default-features
|
||||||
steps:
|
echo "Only voice:"
|
||||||
- uses: actions/checkout@v4
|
cargo check --features="voice" --no-default-features
|
||||||
- name: Check common non-default feature configurations
|
echo "Only voice gateway:"
|
||||||
run: |
|
cargo check --features="voice_gateway" --no-default-features
|
||||||
echo "No features:"
|
echo "Backend + client:"
|
||||||
cargo check --features="" --no-default-features
|
cargo check --features="backend, client" --no-default-features
|
||||||
echo "Only client:"
|
echo "Backend + voice:"
|
||||||
cargo check --features="client" --no-default-features
|
cargo check --features="backend, voice" --no-default-features
|
||||||
echo "Only backend:"
|
echo "Backend + voice gateway:"
|
||||||
cargo check --features="backend" --no-default-features
|
cargo check --features="backend, voice_gateway" --no-default-features
|
||||||
echo "Only voice:"
|
echo "Client + voice gateway:"
|
||||||
cargo check --features="voice" --no-default-features
|
cargo check --features="client, voice_gateway" --no-default-features
|
||||||
echo "Only voice gateway:"
|
# wasm-safari:
|
||||||
cargo check --features="voice_gateway" --no-default-features
|
# runs-on: macos-latest
|
||||||
echo "Backend + client:"
|
# steps:
|
||||||
cargo check --features="backend, client" --no-default-features
|
# - uses: actions/checkout@v4
|
||||||
echo "Backend + voice:"
|
# - name: Clone spacebar server
|
||||||
cargo check --features="backend, voice" --no-default-features
|
# run: |
|
||||||
echo "Backend + voice gateway:"
|
# git clone https://github.com/bitfl0wer/server.git
|
||||||
cargo check --features="backend, voice_gateway" --no-default-features
|
# - uses: actions/setup-node@v4
|
||||||
echo "Client + voice gateway:"
|
# with:
|
||||||
cargo check --features="client, voice_gateway" --no-default-features
|
# 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
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Clone spacebar server
|
- name: Clone spacebar server
|
||||||
run: |
|
run: |
|
||||||
git clone https://github.com/bitfl0wer/server.git
|
git clone https://github.com/bitfl0wer/server.git
|
||||||
- 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: |
|
||||||
npm install
|
npm install
|
||||||
npm run setup
|
npm run setup
|
||||||
npm run start &
|
npm run start &
|
||||||
working-directory: ./server
|
working-directory: ./server
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
cache-all-crates: "true"
|
cache-all-crates: "true"
|
||||||
prefix-key: "macos"
|
prefix-key: "macos"
|
||||||
- name: Run WASM tests with Safari, Firefox, Chrome
|
- name: Run WASM tests with Safari, Firefox, Chrome
|
||||||
run: |
|
run: |
|
||||||
rustup target add wasm32-unknown-unknown
|
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
|
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.92" --force
|
cargo binstall --no-confirm wasm-bindgen-cli --version "0.2.92" --force
|
||||||
GECKODRIVER=$(which geckodriver) cargo test --target wasm32-unknown-unknown --no-default-features --features="client, rt, voice_gateway"
|
GECKODRIVER=$(which geckodriver) cargo test --target wasm32-unknown-unknown --no-default-features --features="client, rt, voice_gateway"
|
||||||
wasm-chrome:
|
wasm-chrome:
|
||||||
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
|
||||||
run: |
|
run: |
|
||||||
git clone https://github.com/bitfl0wer/server.git
|
git clone https://github.com/bitfl0wer/server.git
|
||||||
- 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: |
|
||||||
npm install
|
npm install
|
||||||
npm run setup
|
npm run setup
|
||||||
npm run start &
|
npm run start &
|
||||||
working-directory: ./server
|
working-directory: ./server
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
cache-all-crates: "true"
|
cache-all-crates: "true"
|
||||||
prefix-key: "macos"
|
prefix-key: "macos"
|
||||||
- name: Run WASM tests with Safari, Firefox, Chrome
|
- name: Run WASM tests with Safari, Firefox, Chrome
|
||||||
run: |
|
run: |
|
||||||
rustup target add wasm32-unknown-unknown
|
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
|
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.92" --force
|
cargo binstall --no-confirm wasm-bindgen-cli --version "0.2.92" --force
|
||||||
CHROMEDRIVER=$(which chromedriver) cargo test --target wasm32-unknown-unknown --no-default-features --features="client, rt, voice_gateway"
|
CHROMEDRIVER=$(which chromedriver) cargo test --target wasm32-unknown-unknown --no-default-features --features="client, rt, voice_gateway"
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
|
|
||||||
**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).
|
||||||
|
|
||||||
|
|
|
@ -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: u64,
|
pub limit: u16,
|
||||||
pub window: u64,
|
pub window: u64,
|
||||||
pub enabled: bool,
|
pub enabled: bool,
|
||||||
}
|
}
|
||||||
|
|
|
@ -240,18 +240,13 @@ impl PartialEq for GuildInvite {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Serialize, Deserialize, Debug, Default, Clone, PartialEq, Hash, Eq, PartialOrd, Ord, Copy)]
|
||||||
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: Option<bool>,
|
pub unavailable: bool,
|
||||||
pub geo_restricted: Option<bool>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(Serialize, Deserialize, Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Copy)]
|
||||||
Serialize, Deserialize, Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Copy,
|
|
||||||
)]
|
|
||||||
pub struct GuildCreateResponse {
|
pub struct GuildCreateResponse {
|
||||||
pub id: Snowflake,
|
pub id: Snowflake,
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,15 @@ 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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue