Add clippy workflow update #33
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: Rust | |
on: | |
push: | |
branches: ["main", "*"] | |
pull_request: | |
branches: ["main", "*"] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
# Service containers to run with `runner-job` | |
services: | |
# Label used to access the service container | |
postgres: | |
# Docker Hub image | |
image: postgres | |
# Provide the password for postgres | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: postgres_db | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
# Maps tcp port 5432 on service container to the host | |
- 5432:5432 | |
steps: | |
- name: Install PostgreSQL client | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y postgresql-client | |
# queries database with postgres client | |
- name: Create Database | |
run: psql -h localhost -d postgres -U postgres -c 'CREATE DATABASE "studentdb"' | |
env: | |
PGPASSWORD: postgres | |
- name: Create Table | |
run: psql -h localhost -d studentdb -U postgres -c 'CREATE TABLE | |
public.user_info ( | |
account_id serial NOT NULL, | |
first_name character varying(255) NOT NULL, | |
last_name character varying(255) NOT NULL, | |
username character varying(255) NOT NULL, | |
email character varying(255) NOT NULL, | |
active boolean NOT NULL DEFAULT false, | |
created_at timestamp without time zone NOT NULL DEFAULT now() | |
); | |
ALTER TABLE | |
public.user_info | |
ADD | |
CONSTRAINT student_info_pkey PRIMARY KEY (account_id)' | |
env: | |
PGPASSWORD: postgres | |
- uses: actions/checkout@v3 | |
- name: Build | |
env: | |
DATABASE_URL: postgres://postgres:postgres@localhost:5432/studentdb | |
run: | | |
cargo build --verbose | |
cargo build --release |