version update #1596
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: coverage | |
on: [push] | |
jobs: | |
test: | |
name: coverage | |
runs-on: ubuntu-latest | |
# container: | |
# image: xd009642/tarpaulin:develop-nightly | |
# options: --security-opt seccomp=unconfined | |
steps: | |
- name: Repository Checkout | |
uses: actions/checkout@v4 | |
- name: "Install dependencies" | |
run: | | |
sudo apt-get update && sudo apt-get install -y cmake | |
shell: bash | |
- name: "Install Rust" | |
run: | | |
rustup toolchain install nightly --profile minimal --no-self-update | |
rustup default nightly | |
rustup update | |
shell: bash | |
- name: "Install yt-dlp" | |
run: | | |
curl -sSL --output /usr/local/bin/yt-dlp https://github.com/yt-dlp/yt-dlp/releases/download/latest/yt-dlp_linux | |
chmod +x /usr/local/bin/yt-dlp | |
shell: bash | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: "coverage" | |
- name: "Install cargo-tarpaulin" | |
run: | | |
cargo install cargo-tarpaulin | |
shell: bash | |
- name: Install sqlx-cli | |
run: cargo install sqlx-cli --no-default-features --features postgres | |
- uses: ikalnytskyi/action-setup-postgres@v4 | |
with: | |
username: postgres | |
password: mysecretpassword | |
database: postgres | |
port: 5432 | |
id: postgres | |
- name: Migrate database | |
env: | |
DATABASE_URL: ${{ steps.postgres.outputs.connection-uri }} | |
PG_USER: postgres | |
PG_PASSWORD: mysecretpassword | |
VIRUSTOTAL_API_KEY: ${{secrets.VIRUSTOTAL_API_KEY}} | |
WEBHOOK_SECRET: ${{secrets.WEBHOOK_SECRET}} | |
run: | | |
sqlx database create | |
sqlx migrate run --source migrations/ | |
cargo sqlx prepare --workspace -- --tests --all | |
- name: Generate code coverage | |
env: | |
DATABASE_URL: ${{ steps.postgres.outputs.connection-uri }} | |
PG_USER: postgres | |
PG_PASSWORD: mysecretpassword | |
VIRUSTOTAL_API_KEY: ${{secrets.VIRUSTOTAL_API_KEY}} | |
WEBHOOK_SECRET: ${{secrets.WEBHOOK_SECRET}} | |
run: | | |
cargo tarpaulin --ignore-tests --verbose --all --timeout 120 --out xml | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{secrets.CODECOV_TOKEN}} # not required for public repos | |
fail_ci_if_error: false |