Skip to content

Commit

Permalink
Change trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
macpie committed May 14, 2024
1 parent 8a91643 commit 3e8456a
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 52 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/Package.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand All @@ -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
Expand Down
94 changes: 47 additions & 47 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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

0 comments on commit 3e8456a

Please sign in to comment.