Skip to content

fixing workflow

fixing workflow #1391

Workflow file for this run

name: Test and Build Rust
on:
push:
pull_request:
types: [opened, reopened]
schedule:
# Check if it works with current dependencies (weekly on Wednesday 2:32 UTC)
- cron: '32 2 * * 3'
jobs:
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
components: clippy
override: true
profile: minimal
toolchain: stable
- name: Run clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --verbose --all-targets --all-features -- -D warnings
test_postgres:
name: Test postgres
runs-on: ubuntu-latest
env:
DATABASE_URL: postgres://postgres:postgres@localhost/fang
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
# Set health checks to wait until postgres has started
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
components: clippy
override: true
profile: minimal
toolchain: stable
- name: Install diesel-cli
uses: actions-rs/cargo@v1
with:
command: install
args: diesel_cli --no-default-features --features postgres
- name: Setup Postgres db
working-directory: ./fang/postgres_migrations
run: diesel setup --database-url "postgres://postgres:postgres@localhost/fang"
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test "asynk::async_queue::postgres"
args: --verbose --features asynk-postgres
- name: Run dirty tests
uses: actions-rs/cargo@v1
with:
command: test "asynk::async_queue::postgres"
args: --verbose features asynk-postgres -- --ignored
test_sqlite:
name: Test sqlite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
components: clippy
override: true
profile: minimal
toolchain: stable
- name: Install sqlite3
run: |
sudo apt install -y sqlite3
sqlite3 fang.db "VACUUM;"
mkdir tests_sqlite
- name: Install diesel-cli
uses: actions-rs/cargo@v1
with:
command: install
args: diesel_cli --no-default-features --features sqlite
- name: Setup Sqlite db
working-directory: ./fang/sqlite_migrations
run: diesel setup --database-url "sqlite3://../../../fang.db"
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test "asynk::async_queue::sqlite"
args: --verbose --features asynk-sqlite
- name: Run dirty tests
uses: actions-rs/cargo@v1
with:
command: test "asynk::async_queue::sqlite"
args: --verbose --features asynk-sqlite -- --ignored
release:
name: Release x86_64-unknown-linux-gnu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
override: true
profile: minimal
target: x86_64-unknown-linux-gnu
toolchain: stable
- name: Build release
uses: actions-rs/cargo@v1
with:
command: build
args: --release --verbose --all-features --target x86_64-unknown-linux-gnu