feat: display guild count in bot status #736
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
permissions: | |
pull-requests: write | |
contents: write | |
defaults: | |
run: | |
shell: bash | |
working-directory: ./ | |
env: | |
AWS_REGION: ${{ secrets.AWS_REGION }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
DISCORD_CMD_PREFIX: "~" | |
DISCORD_TOKEN: "dummy" | |
jobs: | |
check: | |
# Run `cargo check` first to ensure that the pushed code at least compiles. | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
profile: minimal | |
components: clippy | |
# caching | |
- name: Cache cargo registry | |
uses: actions/[email protected] | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-v1-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo index | |
uses: actions/[email protected] | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-v1-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo target dir | |
uses: actions/[email protected] | |
with: | |
path: target | |
key: ${{ runner.os }}-v1-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | |
# /caching | |
- name: Check | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --all --all-targets --all-features | |
- name: rustfmt | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
check-docs: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
profile: minimal | |
# caching | |
- name: Cache cargo registry | |
uses: actions/[email protected] | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-v1-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo index | |
uses: actions/[email protected] | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-v1-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo target dir | |
uses: actions/[email protected] | |
with: | |
path: target | |
key: ${{ runner.os }}-v1-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | |
# /caching | |
- name: cargo doc | |
working-directory: ${{ matrix.subcrate }} | |
env: | |
RUSTDOCFLAGS: "-D broken-intra-doc-links" | |
run: cargo doc --all-features --no-deps | |
cargo-hack: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
profile: minimal | |
# caching | |
- name: Cache cargo registry | |
uses: actions/[email protected] | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-v1-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo index | |
uses: actions/[email protected] | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-v1-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo target dir | |
uses: actions/[email protected] | |
with: | |
path: target | |
key: ${{ runner.os }}-v1-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | |
# /caching | |
- name: Install cargo-hack | |
run: | | |
curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin | |
- name: cargo hack check | |
working-directory: ${{ matrix.subcrate }} | |
run: cargo hack check --each-feature --no-dev-deps --all | |
test-versions: | |
# Test against the stable, beta, and nightly Rust toolchains on ubuntu-latest. | |
needs: check | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
strategy: | |
matrix: | |
rust: | |
- stable | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
override: true | |
profile: minimal | |
# caching | |
- name: Cache cargo registry | |
uses: actions/[email protected] | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-v1-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo index | |
uses: actions/[email protected] | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-v1-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo target dir | |
uses: actions/[email protected] | |
with: | |
path: target | |
key: ${{ runner.os }}-v1-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install tools | |
run: | | |
sudo apt-get update && \ | |
sudo apt-get install -y \ | |
libopus-dev \ | |
build-essential \ | |
libssl-dev \ | |
pkg-config \ | |
autoconf \ | |
automake \ | |
libtool \ | |
m4 \ | |
ffmpeg \ | |
curl \ | |
python3 \ | |
git | |
sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/bin/yt-dlp && \ | |
sudo chmod a+rx /usr/bin/yt-dlp | |
# /caching | |
- name: Run tests | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --all --all-features --all-targets | |
renovate: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
if: ${{ github.actor == 'renovate[bot]' }} | |
needs: test-versions | |
steps: | |
- name: Dependabot metadata | |
id: metadata | |
uses: dependabot/[email protected] | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Enable auto-merge for Dependabot PRs | |
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' }} | |
run: gh pr merge --auto --merge "$PR_URL" | |
env: | |
PR_URL: ${{github.event.pull_request.html_url}} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |