Skip to content

Commit af19c53

Browse files
Merge pull request #3 from threshold-network/main
ci(contracts): simplify workflow triggers
2 parents f85846f + 900d18e commit af19c53

2 files changed

Lines changed: 8 additions & 66 deletions

File tree

.github/workflows/contracts-ecdsa.yml

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
name: Solidity ECDSA
22

33
on:
4-
schedule:
5-
- cron: "0 0 * * *"
6-
push:
7-
branches:
8-
- main
9-
paths:
10-
- "solidity/ecdsa/**"
11-
- ".github/workflows/contracts-ecdsa.yml"
12-
pull_request:
134
# We intend to use `workflow dispatch` in two different situations/paths:
145
# 1. If a workflow will be manually dispatched from branch named
156
# `dapp-development`, workflow will deploy the contracts on the selected
@@ -41,25 +32,14 @@ jobs:
4132
contracts-detect-changes:
4233
runs-on: ubuntu-latest
4334
outputs:
44-
path-filter: ${{ steps.filter.outputs.path-filter }}
35+
path-filter: ${{ steps.set-output.outputs.path-filter }}
4536
steps:
46-
- uses: actions/checkout@v3
47-
if: github.event_name == 'pull_request'
48-
49-
- uses: dorny/paths-filter@v2
50-
if: github.event_name == 'pull_request'
51-
id: filter
52-
with:
53-
filters: |
54-
path-filter:
55-
- './solidity/ecdsa/**'
56-
- './.github/workflows/contracts-ecdsa.yml'
37+
- name: Set path-filter output
38+
id: set-output
39+
run: echo "path-filter=true" >> $GITHUB_OUTPUT
5740

5841
contracts-lint:
5942
needs: contracts-detect-changes
60-
if: |
61-
github.event_name == 'push'
62-
|| needs.contracts-detect-changes.outputs.path-filter == 'true'
6343
runs-on: ubuntu-latest
6444
defaults:
6545
run:
@@ -87,9 +67,6 @@ jobs:
8767

8868
contracts-slither:
8969
needs: contracts-detect-changes
90-
if: |
91-
github.event_name == 'push'
92-
|| needs.contracts-detect-changes.outputs.path-filter == 'true'
9370
runs-on: ubuntu-latest
9471
defaults:
9572
run:
@@ -133,9 +110,6 @@ jobs:
133110

134111
contracts-build-and-test:
135112
needs: contracts-detect-changes
136-
if: |
137-
github.event_name != 'pull_request'
138-
|| needs.contracts-detect-changes.outputs.path-filter == 'true'
139113
runs-on: ubuntu-latest
140114
defaults:
141115
run:
@@ -164,9 +138,6 @@ jobs:
164138

165139
contracts-deployment-dry-run:
166140
needs: contracts-detect-changes
167-
if: |
168-
github.event_name != 'pull_request'
169-
|| needs.contracts-detect-changes.outputs.path-filter == 'true'
170141
runs-on: ubuntu-latest
171142
defaults:
172143
run:

.github/workflows/contracts-random-beacon.yml

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
name: Solidity Random Beacon
22

33
on:
4-
schedule:
5-
- cron: "0 0 * * *"
6-
push:
7-
branches:
8-
- main
9-
paths:
10-
- "solidity/random-beacon/**"
11-
- ".github/workflows/contracts-random-beacon.yml"
12-
pull_request:
134
# We intend to use `workflow dispatch` in two different situations/paths:
145
# 1. If a workflow will be manually dispatched from branch named
156
# `dapp-development`, workflow will deploy the contracts on the selected
@@ -41,25 +32,14 @@ jobs:
4132
contracts-detect-changes:
4233
runs-on: ubuntu-latest
4334
outputs:
44-
path-filter: ${{ steps.filter.outputs.path-filter }}
35+
path-filter: ${{ steps.set-output.outputs.path-filter }}
4536
steps:
46-
- uses: actions/checkout@v3
47-
if: github.event_name == 'pull_request'
48-
49-
- uses: dorny/paths-filter@v2
50-
if: github.event_name == 'pull_request'
51-
id: filter
52-
with:
53-
filters: |
54-
path-filter:
55-
- './solidity/random-beacon/**'
56-
- './.github/workflows/contracts-random-beacon.yml'
37+
- name: Set path-filter output
38+
id: set-output
39+
run: echo "path-filter=true" >> $GITHUB_OUTPUT
5740

5841
contracts-lint:
5942
needs: contracts-detect-changes
60-
if: |
61-
github.event_name == 'push'
62-
|| needs.contracts-detect-changes.outputs.path-filter == 'true'
6343
runs-on: ubuntu-latest
6444
defaults:
6545
run:
@@ -87,9 +67,6 @@ jobs:
8767

8868
contracts-slither:
8969
needs: contracts-detect-changes
90-
if: |
91-
github.event_name == 'push'
92-
|| needs.contracts-detect-changes.outputs.path-filter == 'true'
9370
runs-on: ubuntu-latest
9471
defaults:
9572
run:
@@ -131,9 +108,6 @@ jobs:
131108

132109
contracts-build-and-test:
133110
needs: contracts-detect-changes
134-
if: |
135-
github.event_name != 'pull_request'
136-
|| needs.contracts-detect-changes.outputs.path-filter == 'true'
137111
runs-on: ubuntu-latest
138112
defaults:
139113
run:
@@ -162,9 +136,6 @@ jobs:
162136

163137
contracts-deployment-dry-run:
164138
needs: contracts-detect-changes
165-
if: |
166-
github.event_name != 'pull_request'
167-
|| needs.contracts-detect-changes.outputs.path-filter == 'true'
168139
runs-on: ubuntu-latest
169140
defaults:
170141
run:

0 commit comments

Comments
 (0)