Merge branch 'main' of github.com:donald-pinckney/npm-follower #347
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: Rust | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
CARGO_TERM_COLOR: always | |
DATABASE_URL: postgres://donald:password@localhost/npm_data | |
TESTING_DATABASE_URL: postgres://donald:password@localhost/testing_npm_data | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup PostgreSQL | |
# You may pin to the exact commit or the version. | |
# uses: Harmon758/postgresql-action@0be19fa37850b22cb4c9bbf28a03abbf44abd863 | |
uses: Harmon758/postgresql-action@v1.0.0 | |
with: | |
# Version of PostgreSQL to use | |
postgresql version: 15 | |
postgresql db: npm_data | |
postgresql user: donald | |
postgresql password: password | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3.3.0 | |
- name: Setup Redis | |
uses: zhulik/redis-action@1.1.0 | |
with: | |
redis version: '7.0.7' | |
number of databases: 16 | |
- name: Install Diesel | |
run: cargo install diesel_cli@2.0.1 --no-default-features --features postgres | |
- name: Setup Diesel | |
run: cd postgres_db && diesel setup --locked-schema | |
# - name: Check Other `tarball_analysis` Schema is Up-to-Date | |
# run: cd postgres_db && diesel print-schema --config-file diesel_tarball_analysis.toml | diff src/schema/schema_tarball_analysis.rs - | |
- name: Check | |
run: cargo check --verbose | |
- name: Clippy | |
run: cargo clippy --verbose | |
- name: Format | |
run: cargo fmt --check --verbose | |
- name: Run tests | |
run: cargo test --verbose | |
# - name: Run benchmarks | |
# run: cargo bench --verbose |