🕹️ Implement Playback Controller #39
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: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
env: | |
CARGO_TERM_COLOR: always | |
BOT_TOKEN: ~ | |
SERVER_ADDRESS: ~ | |
SERVER_PORT: ~ | |
LAVALINK_SERVER_PASSWORD: ~ | |
DATABASE_URL: postgres://user:password@localhost:5432/db | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_DB: db | |
POSTGRES_USER: user | |
POSTGRES_PASSWORD: password | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Codespell | |
uses: codespell-project/actions-codespell@v1 | |
- name: Setup Mold | |
uses: rui314/setup-mold@v1 | |
- name: Rust Cache | |
uses: Swatinem/[email protected] | |
- name: Setup Database | |
working-directory: database | |
run: | | |
cargo install sqlx-cli --no-default-features --features native-tls,postgres | |
cargo sqlx database setup | |
- name: Setup .env | |
run: touch .env | |
- name: Build And Test | |
run: | | |
cargo build --verbose | |
cargo test --verbose |