From 3951ed4be10150fa10a2ee81b68b664249b15f87 Mon Sep 17 00:00:00 2001 From: raykast Date: Thu, 4 Aug 2022 17:45:48 -0700 Subject: [PATCH] Update GitHub workflows. --- .github/workflows/cargo.yml | 37 ++++++++++---- .github/workflows/cargo_test.yml | 32 ++++++++++-- .../workflows/deploy_to_heroku_production.yml | 50 ------------------- .../workflows/deploy_to_heroku_staging.yml | 40 --------------- 4 files changed, 54 insertions(+), 105 deletions(-) delete mode 100644 .github/workflows/deploy_to_heroku_production.yml delete mode 100644 .github/workflows/deploy_to_heroku_staging.yml diff --git a/.github/workflows/cargo.yml b/.github/workflows/cargo.yml index 668f46f44..b66b4d12e 100644 --- a/.github/workflows/cargo.yml +++ b/.github/workflows/cargo.yml @@ -17,10 +17,11 @@ 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 + args: --workspace --check debug-check: name: cargo check/doc/clippy (debug profile) @@ -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) @@ -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 diff --git a/.github/workflows/cargo_test.yml b/.github/workflows/cargo_test.yml index cc5bb8f6a..336555d54 100644 --- a/.github/workflows/cargo_test.yml +++ b/.github/workflows/cargo_test.yml @@ -2,7 +2,7 @@ name: Cargo test on: pull_request: - branches: [master] + branches: [dev, master] push: branches: [dev, master] @@ -18,6 +18,10 @@ jobs: components: cargo, rustc profile: minimal + - name: set up environment + run: | + docker-compose up -d + - uses: actions/cache@v3 with: path: | @@ -28,10 +32,17 @@ 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 + with: + command: test + args: --workspace --lib --all-features --profile=debug-lite + + - name: cargo test --bins + uses: actions-rs/cargo@v1 with: command: test - args: --all --lib --bins --all-features --profile=debug-lite + args: --workspace --bins --all-features --profile=debug-lite release-build: name: cargo build/test (release profile) @@ -44,6 +55,10 @@ jobs: components: cargo, rustc profile: minimal + - name: set up environment + run: | + docker-compose up -d + - uses: actions/cache@v3 with: path: | @@ -54,7 +69,14 @@ 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 + with: + command: test + args: --workspace --lib --all-features --profile=release-lite + + - name: cargo test --bins --release + uses: actions-rs/cargo@v1 with: command: test - args: --all --lib --bins --all-features --profile=release-lite + args: --workspace --bins --all-features --profile=release-lite diff --git a/.github/workflows/deploy_to_heroku_production.yml b/.github/workflows/deploy_to_heroku_production.yml deleted file mode 100644 index 5343585cf..000000000 --- a/.github/workflows/deploy_to_heroku_production.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Heroku (production) - -on: - push: - branches: [master] - -jobs: - build: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - - name: Geyser consumer - uses: gonuit/heroku-docker-deploy@v1.3.3 - with: - email: ${{ secrets.HEROKU_EMAIL }} - heroku_api_key: ${{ secrets.HEROKU_API_KEY }} - heroku_app_name: accounts-db-consumer - dockerfile_name: Dockerfile - docker_options: '--target geyser-consumer' - process_type: worker - - - name: HTTP consumer - uses: gonuit/heroku-docker-deploy@v1.3.3 - with: - email: ${{ secrets.HEROKU_EMAIL }} - heroku_api_key: ${{ secrets.HEROKU_API_KEY }} - heroku_app_name: accountsdbhttpconsumer - dockerfile_name: Dockerfile - docker_options: '--target http-consumer' - process_type: worker - - - name: GraphQL server - uses: gonuit/heroku-docker-deploy@v1.3.3 - with: - email: ${{ secrets.HEROKU_EMAIL }} - heroku_api_key: ${{ secrets.HEROKU_API_KEY }} - heroku_app_name: indexer-graphql - dockerfile_name: Dockerfile - docker_options: '--target graphql' - - - name: Storefronts Indexer - uses: gonuit/heroku-docker-deploy@v1.3.3 - with: - email: ${{ secrets.HEROKU_EMAIL }} - heroku_api_key: ${{ secrets.HEROKU_API_KEY }} - heroku_app_name: legacy-storefronts - dockerfile_name: Dockerfile - docker_options: '--target legacy-storefronts' - process_type: worker diff --git a/.github/workflows/deploy_to_heroku_staging.yml b/.github/workflows/deploy_to_heroku_staging.yml deleted file mode 100644 index 565452a4d..000000000 --- a/.github/workflows/deploy_to_heroku_staging.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Heroku (staging) - -on: - push: - branches: [dev, deploy_config, debug_validator] - -jobs: - build: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - - name: Geyser consumer - uses: gonuit/heroku-docker-deploy@v1.3.3 - with: - email: ${{ secrets.HEROKU_EMAIL }} - heroku_api_key: ${{ secrets.HEROKU_API_KEY }} - heroku_app_name: accounts-db-consumer-staging - dockerfile_name: Dockerfile - docker_options: '--target geyser-consumer' - process_type: worker - - - name: HTTP consumer - uses: gonuit/heroku-docker-deploy@v1.3.3 - with: - email: ${{ secrets.HEROKU_EMAIL }} - heroku_api_key: ${{ secrets.HEROKU_API_KEY }} - heroku_app_name: accountsdbhttpconsumerstaging - dockerfile_name: Dockerfile - docker_options: '--target http-consumer' - process_type: worker - - - name: GraphQL server - uses: gonuit/heroku-docker-deploy@v1.3.3 - with: - email: ${{ secrets.HEROKU_EMAIL }} - heroku_api_key: ${{ secrets.HEROKU_API_KEY }} - heroku_app_name: indexer-graphql-staging - dockerfile_name: Dockerfile - docker_options: '--target graphql'