Skip to content

Commit

Permalink
chore(test): run weaver tests on schedule
Browse files Browse the repository at this point in the history
Primary change:

Creates a central workflow to
run all 13 weaver test workflows from either a
push, a pull request, a github command,
or a schedule.

Passes a 'run_all' boolean to sub-workflows
to specify if all tests should be run, not
just those with changes.

Secondary changes:
- update concurrency groups to allow triggering
  from central workflow
- remove ability to run the 13 workflows
  individually to declutter ci menu

Signed-off-by: Jennifer Bell <jenniferlianne@gmail.com>

check whether RUN_ALL can be calculated in the environment instead of as a job

rename weaver test file

update actionlint to latest
  • Loading branch information
Jennifer Bell committed Jul 25, 2024
1 parent d8a99c6 commit 5d34cc3
Show file tree
Hide file tree
Showing 14 changed files with 175 additions and 106 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/actionlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

- name: actionlint
id: actionlint
uses: raven-actions/actionlint@v1.0.3
uses: raven-actions/actionlint@v2
with:
version: 1.6.27
cache: true
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/ci_weaver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Weaver_CI

# Controls when the workflow will run
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
# run at 1am the first day of every month
- cron: "0 1 1 * *"

env:
RUN_ALL: "${{github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }}"

jobs:

fabric-fabric-satp:
with:
run_all: $RUN_ALL
uses: ./.github/workflows/test_weaver-fabric-fabric-satp.yaml

Check failure on line 22 in .github/workflows/ci_weaver.yaml

View workflow job for this annotation

GitHub Actions / ActionLint / Lint_GitHub_Actions

could not read reusable workflow file for "./.github/workflows/test_weaver-fabric-fabric-satp.yaml": open /home/runner/work/cacti/cacti/.github/workflows/test_weaver-fabric-fabric-satp.yaml: no such file or directory
asset-exchange-corda:
with:
run_all: $RUN_ALL
uses: ./.github/workflows/test_weaver-asset-exchange-corda.yaml

Check failure on line 26 in .github/workflows/ci_weaver.yaml

View workflow job for this annotation

GitHub Actions / ActionLint / Lint_GitHub_Actions

could not read reusable workflow file for "./.github/workflows/test_weaver-asset-exchange-corda.yaml": open /home/runner/work/cacti/cacti/.github/workflows/test_weaver-asset-exchange-corda.yaml: no such file or directory
asset-transfer:
with:
run_all: $RUN_ALL
uses: ./.github/workflows/test_weaver-asset-transfer.yaml

Check failure on line 30 in .github/workflows/ci_weaver.yaml

View workflow job for this annotation

GitHub Actions / ActionLint / Lint_GitHub_Actions

could not read reusable workflow file for "./.github/workflows/test_weaver-asset-transfer.yaml": open /home/runner/work/cacti/cacti/.github/workflows/test_weaver-asset-transfer.yaml: no such file or directory
relay:
with:
run_all: $RUN_ALL
uses: ./.github/workflows/test_weaver-relay.yaml

Check failure on line 34 in .github/workflows/ci_weaver.yaml

View workflow job for this annotation

GitHub Actions / ActionLint / Lint_GitHub_Actions

could not read reusable workflow file for "./.github/workflows/test_weaver-relay.yaml": open /home/runner/work/cacti/cacti/.github/workflows/test_weaver-relay.yaml: no such file or directory
corda-interop-app:
with:
run_all: $RUN_ALL
uses: ./.github/workflows/test_weaver-corda-interop-app.yaml

Check failure on line 38 in .github/workflows/ci_weaver.yaml

View workflow job for this annotation

GitHub Actions / ActionLint / Lint_GitHub_Actions

could not read reusable workflow file for "./.github/workflows/test_weaver-corda-interop-app.yaml": open /home/runner/work/cacti/cacti/.github/workflows/test_weaver-corda-interop-app.yaml: no such file or directory
pre-release:
with:
run_all: $RUN_ALL
uses: ./.github/workflows/test_weaver-pre-release.yaml

Check failure on line 42 in .github/workflows/ci_weaver.yaml

View workflow job for this annotation

GitHub Actions / ActionLint / Lint_GitHub_Actions

could not read reusable workflow file for "./.github/workflows/test_weaver-pre-release.yaml": open /home/runner/work/cacti/cacti/.github/workflows/test_weaver-pre-release.yaml: no such file or directory
asset-exchange-fabric:
with:
run_all: $RUN_ALL
uses: ./.github/workflows/test_weaver-asset-exchange-fabric.yaml

Check failure on line 46 in .github/workflows/ci_weaver.yaml

View workflow job for this annotation

GitHub Actions / ActionLint / Lint_GitHub_Actions

could not read reusable workflow file for "./.github/workflows/test_weaver-asset-exchange-fabric.yaml": open /home/runner/work/cacti/cacti/.github/workflows/test_weaver-asset-exchange-fabric.yaml: no such file or directory
data-sharing:
with:
run_all: $RUN_ALL
uses: ./.github/workflows/test_weaver-data-sharing.yaml

Check failure on line 50 in .github/workflows/ci_weaver.yaml

View workflow job for this annotation

GitHub Actions / ActionLint / Lint_GitHub_Actions

could not read reusable workflow file for "./.github/workflows/test_weaver-data-sharing.yaml": open /home/runner/work/cacti/cacti/.github/workflows/test_weaver-data-sharing.yaml: no such file or directory
node-pkgs:
with:
run_all: $RUN_ALL
uses: ./.github/workflows/test_weaver-node-pkgs.yaml

Check failure on line 54 in .github/workflows/ci_weaver.yaml

View workflow job for this annotation

GitHub Actions / ActionLint / Lint_GitHub_Actions

could not read reusable workflow file for "./.github/workflows/test_weaver-node-pkgs.yaml": open /home/runner/work/cacti/cacti/.github/workflows/test_weaver-node-pkgs.yaml: no such file or directory
docker-build:
with:
run_all: $RUN_ALL
uses: ./.github/workflows/test_weaver-docker-build.yaml

Check failure on line 58 in .github/workflows/ci_weaver.yaml

View workflow job for this annotation

GitHub Actions / ActionLint / Lint_GitHub_Actions

could not read reusable workflow file for "./.github/workflows/test_weaver-docker-build.yaml": open /home/runner/work/cacti/cacti/.github/workflows/test_weaver-docker-build.yaml: no such file or directory
asset-exchange-besu:
with:
run_all: $RUN_ALL
uses: ./.github/workflows/test_weaver-asset-exchange-besu.yaml
go:
with:
run_all: $RUN_ALL
uses: ./.github/workflows/test_weaver-go.yaml

15 changes: 6 additions & 9 deletions .github/workflows/test_weaver-asset-exchange-besu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@ env:

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
workflow_call:
inputs:
run_all:
required: true
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: asset-exchange-besu-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/test_weaver-asset-exchange-corda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@ name: Test Asset Exchange Corda
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
workflow_call:
inputs:
run_all:
required: true
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: asset-exchange-corda-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
Expand Down Expand Up @@ -137,7 +135,7 @@ jobs:

asset-exchange-corda-local:
needs: check_code_changed
if: needs.check_code_changed.outputs.status == 'true'
if: inputs.run_all == 'true' || needs.check_code_changed.outputs.status == 'true'
# The type of runner that the job will run on
runs-on: ubuntu-22.04

Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/test_weaver-asset-exchange-fabric.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@ env:

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]

pull_request:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
workflow_call:
inputs:
run_all:
required: true
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: asset-exchange-fabric-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
Expand Down Expand Up @@ -122,7 +119,7 @@ jobs:

asset-exchange-fabric-local:
needs: check_code_changed
if: needs.check_code_changed.outputs.status == 'true'
if: ${{ inputs.run_all == 'true' || needs.check_code_changed.outputs.status == 'true' }}
# if: ${{ false }}
# The type of runner that the job will run on
runs-on: ubuntu-22.04
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/test_weaver-asset-transfer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@ env:
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
workflow_call:
inputs:
run_all:
required: true
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: asset-transfer-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
Expand Down Expand Up @@ -687,7 +685,7 @@ jobs:

asset-transfer-local:
needs: check_code_changed
if: needs.check_code_changed.outputs.status == 'true'
if: inputs.run_all == 'true' || needs.check_code_changed.outputs.status == 'true'
# if: ${{ false }}
# The type of runner that the job will run on
runs-on: ubuntu-22.04
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/test_weaver-corda-interop-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
name: Unit Test Corda Interop App

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_call:
inputs:
run_all:
required: true
type: string


concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: corda-interop-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
Expand All @@ -36,7 +38,7 @@ jobs:
unit_test_interop_cordapp:
needs: check_code_changed
if: needs.check_code_changed.outputs.interop_cordapp_changed == 'true'
if: inputs.run_all == 'true' || needs.check_code_changed.outputs.interop_cordapp_changed == 'true'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4.1.1
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/test_weaver-data-sharing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,15 @@ env:

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_call:
inputs:
run_all:
required: true
type: string

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: data-sharing-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
Expand Down Expand Up @@ -410,7 +408,7 @@ jobs:

data-sharing-docker-local:
needs: check_code_changed
if: needs.check_code_changed.outputs.status == 'true'
if: inputs.run_all == 'true' || needs.check_code_changed.outputs.status == 'true'
# if: ${{ false }}
# The type of runner that the job will run on
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -835,7 +833,7 @@ jobs:

data-sharing-local:
needs: check_code_changed
if: needs.check_code_changed.outputs.status == 'true'
if: inputs.run_all == 'true' || needs.check_code_changed.outputs.status == 'true'
# if: ${{ false }}
# The type of runner that the job will run on
runs-on: ubuntu-22.04
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/test_weaver-docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ env:
NODEJS_VERSION: v18.18.2

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_call:
inputs:
run_all:
required: true
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: docker-build-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -61,7 +62,7 @@ jobs:
build_docker_relay:
needs: check_code_changed
if: needs.check_code_changed.outputs.relay_changed == 'true'
if: inputs.run_all == 'true' || needs.check_code_changed.outputs.relay_changed == 'true'
# if: ${{ false }}
runs-on: ubuntu-22.04
steps:
Expand All @@ -74,7 +75,7 @@ jobs:

build_docker_fabric_driver_local:
needs: check_code_changed
if: needs.check_code_changed.outputs.fabric_driver_changed == 'true'
if: inputs.run_all == 'true' || needs.check_code_changed.outputs.fabric_driver_changed == 'true'
# if: ${{ false }}
runs-on: ubuntu-22.04
steps:
Expand Down Expand Up @@ -126,7 +127,7 @@ jobs:

build_docker_corda_driver_local:
needs: check_code_changed
if: needs.check_code_changed.outputs.corda_driver_changed == 'true'
if: inputs.run_all == 'true' || needs.check_code_changed.outputs.corda_driver_changed == 'true'
runs-on: ubuntu-22.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
Expand Down Expand Up @@ -186,7 +187,7 @@ jobs:

build_docker_iin_agent_local:
needs: check_code_changed
if: needs.check_code_changed.outputs.iin_agent_changed == 'true'
if: inputs.run_all == 'true' || needs.check_code_changed.outputs.iin_agent_changed == 'true'
runs-on: ubuntu-22.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/test_weaver-fabric-fabric-satp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ name: Secure Test Asset Transfer
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
workflow_call:
inputs:
run_all:
required: true
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
group: fabric-satp-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
Expand Down
Loading

0 comments on commit 5d34cc3

Please sign in to comment.