From 3e8456aeed1eafd459cac9150bb553494162a6f9 Mon Sep 17 00:00:00 2001 From: Macpie Date: Tue, 14 May 2024 10:49:37 -0700 Subject: [PATCH] Change trigger --- .github/workflows/Package.yml | 16 ++++-- .github/workflows/Tests.yml | 94 +++++++++++++++++------------------ 2 files changed, 58 insertions(+), 52 deletions(-) diff --git a/.github/workflows/Package.yml b/.github/workflows/Package.yml index 725884984..d2afd4bcf 100644 --- a/.github/workflows/Package.yml +++ b/.github/workflows/Package.yml @@ -1,9 +1,16 @@ name: Package +# on: +# workflow_run: +# workflows: [Tests] +# types: [completed] + on: - workflow_run: - workflows: [Tests] - types: [completed] + pull_request: + branches: [main] + push: + branches: ["main"] + tags: ["*"] env: CARGO_INCREMENTAL: 0 # this setting is automatically applied by rust-cache but documented here for explicitness @@ -15,7 +22,7 @@ env: jobs: on-failure: runs-on: oracles-20.04 - if: ${{ github.event.workflow_run.conclusion == 'failure' }} + # if: ${{ github.event.workflow_run.conclusion == 'failure' }} steps: - run: echo 'The triggering workflow failed' on-success: @@ -24,7 +31,6 @@ jobs: group: ${{ github.workflow }}-${{ github.ref }}-build-release cancel-in-progress: true # if: ${{ github.event.workflow_run.conclusion == 'success' }} && contains(github.ref, 'refs/tags/') - if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index a58fdb3f7..53fb79e4f 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -108,50 +108,50 @@ jobs: - name: Clippy run: cargo clippy --all-targets -- -Dclippy::all -D warnings - # tests: - # needs: build - # runs-on: oracles-20.04 - # strategy: - # fail-fast: false - # matrix: - # package: [boost-manager,file-store,ingest,iot-config,iot-packet-verifier,iot-verifier,mobile-config,mobile-packet-verifier,mobile-verifier,reward-scheduler,task-manager] - # concurrency: - # group: ${{ github.workflow }}-${{ github.ref }}-tests-${{ matrix.package }} - # cancel-in-progress: true - # services: - # postgres: - # image: postgres - # env: - # POSTGRES_PASSWORD: postgres - # options: >- - # --health-cmd pg_isready - # --health-interval 10s - # --health-timeout 5s - # --health-retries 5 - # ports: - # - 5432:5432 - # steps: - # - name: Checkout - # uses: actions/checkout@v4 - - # - name: Rust install - # uses: dtolnay/rust-toolchain@stable - - # - name: Install protoc - # run: sudo apt-get install -y protobuf-compiler - - # - name: Cache - # uses: actions/cache@v4 - # with: - # path: | - # ~/.cargo/bin/ - # ~/.cargo/registry/index/ - # ~/.cargo/registry/cache/ - # ~/.cargo/git/db/ - # target/ - # key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - # - name: Run unit and integration tests - # env: - # DATABASE_URL: "postgres://postgres:postgres@localhost:5432/postgres" - # run: cargo test -p ${{ matrix.package }} -- --include-ignored \ No newline at end of file + tests: + needs: build + runs-on: oracles-20.04 + strategy: + fail-fast: false + matrix: + package: [boost-manager,file-store,ingest,iot-config,iot-packet-verifier,iot-verifier,mobile-config,mobile-packet-verifier,mobile-verifier,reward-scheduler,task-manager] + concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-tests-${{ matrix.package }} + cancel-in-progress: true + services: + postgres: + image: postgres + env: + POSTGRES_PASSWORD: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Rust install + uses: dtolnay/rust-toolchain@stable + + - name: Install protoc + run: sudo apt-get install -y protobuf-compiler + + - name: Cache + uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: Run unit and integration tests + env: + DATABASE_URL: "postgres://postgres:postgres@localhost:5432/postgres" + run: cargo test -p ${{ matrix.package }} -- --include-ignored \ No newline at end of file