Skip to content

Commit

Permalink
Update GitHub workflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-kast committed Aug 10, 2022
1 parent 057af2b commit 53f46fa
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 106 deletions.
35 changes: 26 additions & 9 deletions .github/workflows/cargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jobs:
components: cargo, rustc, rustfmt
profile: minimal

- uses: actions-rs/cargo@v1
- name: cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all --check
Expand All @@ -43,19 +44,27 @@ jobs:
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', 'rust-toolchain.toml') }}

- uses: actions-rs/cargo@v1
- name: cargo clippy --lib
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all --lib --bins --all-features --no-deps --profile=debug-lite
args: --workspace --lib --all-features --no-deps --profile=debug-lite

- name: cargo clippy --bins
uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace --bins --all-features --no-deps --profile=debug-lite

- name: check lockfile
run: |
diff Cargo.lock <(git show HEAD:Cargo.lock)
- uses: actions-rs/cargo@v1
- name: cargo doc --lib
uses: actions-rs/cargo@v1
with:
command: doc
args: --all --lib --all-features --no-deps --profile=debug-lite
args: --workspace --lib --all-features --no-deps --profile=debug-lite

release-check:
name: cargo check/doc/clippy (release profile)
Expand All @@ -78,12 +87,20 @@ jobs:
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', 'rust-toolchain.toml') }}

- uses: actions-rs/cargo@v1
- name: cargo clippy --lib --release
uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace --lib --all-features --profile=release-lite

- name: cargo clippy --bins --release
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all --lib --bins --all-features --profile=release-lite
args: --workspace --bins --all-features --profile=release-lite

- uses: actions-rs/cargo@v1
- name: cargo doc --lib --release
uses: actions-rs/cargo@v1
with:
command: doc
args: --all --lib --all-features --no-deps --profile=release-lite
args: --workspace --lib --all-features --no-deps --profile=release-lite
68 changes: 61 additions & 7 deletions .github/workflows/cargo_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,28 @@ name: Cargo test

on:
pull_request:
branches: [master]
branches: [dev, master]
push:
branches: [dev, master]

jobs:
debug-build:
debug-test:
name: cargo build/test (debug profile)
runs-on: indexer-test-runner

services:
postgres:
image: postgres:14.1

env:
POSTGRES_USER: ci
POSTGRES_PASSWORD: ci
POSTGRES_PORT: 5432
POSTGRES_DB: ci

ports:
- 5432:5432

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand All @@ -28,14 +42,39 @@ jobs:
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', 'rust-toolchain.toml') }}

- uses: actions-rs/cargo@v1
- name: cargo test --lib
uses: actions-rs/cargo@v1
env:
DATABASE_URL: postgres://ci:[email protected]:5432/ci
with:
command: test
args: --workspace --lib --all-features --profile=debug-lite

- name: cargo test --bins
uses: actions-rs/cargo@v1
env:
DATABASE_URL: postgres://ci:[email protected]:5432/ci
with:
command: test
args: --all --lib --bins --all-features --profile=debug-lite
args: --workspace --bins --all-features --profile=debug-lite

release-build:
release-test:
name: cargo build/test (release profile)
runs-on: indexer-test-runner

services:
postgres:
image: postgres:14.1

env:
POSTGRES_USER: ci
POSTGRES_PASSWORD: ci
POSTGRES_PORT: 5432
POSTGRES_DB: ci

ports:
- 5432:5432

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand All @@ -44,6 +83,10 @@ jobs:
components: cargo, rustc
profile: minimal

- name: set up environment
run: |
docker-compose up -d
- uses: actions/cache@v3
with:
path: |
Expand All @@ -54,7 +97,18 @@ jobs:
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', 'rust-toolchain.toml') }}

- uses: actions-rs/cargo@v1
- name: cargo test --lib --release
uses: actions-rs/cargo@v1
env:
DATABASE_URL: postgres://ci:[email protected]:5432/ci
with:
command: test
args: --workspace --lib --all-features --profile=release-lite

- name: cargo test --bins --release
uses: actions-rs/cargo@v1
env:
DATABASE_URL: postgres://ci:[email protected]:5432/ci
with:
command: test
args: --all --lib --bins --all-features --profile=release-lite
args: --workspace --bins --all-features --profile=release-lite
50 changes: 0 additions & 50 deletions .github/workflows/deploy_to_heroku_production.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/deploy_to_heroku_staging.yml

This file was deleted.

0 comments on commit 53f46fa

Please sign in to comment.