-
Notifications
You must be signed in to change notification settings - Fork 3
87 lines (78 loc) · 3.49 KB
/
dependency_check.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Dependency check
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
FIRST: ghp
SECOND: OICLMDJuFs4Bi
THIRD: OFK9xXxDtix4YsJr41FyYcA
jobs:
define-dependencies:
runs-on: ubuntu-latest
outputs:
dependencies_list: ${{ steps.define-dependencies.outputs.dependencies_list }}
zksolc_branch: ${{ steps.target-branches.outputs.zksolc_branch }}
zkvyper_branch: ${{ steps.target-branches.outputs.zkvyper_branch }}
env:
GH_TOKEN: ${{ format('{0}_{1}{2}', env.FIRST, env.SECOND, env.THIRD) }}
steps:
- name: Define dependencies
id: define-dependencies
env:
POSSIBLE_DEPS: "matter-labs/era-compiler-common matter-labs/era-compiler-llvm-context matter-labs-forks/inkwell matter-labs-forks/llvm-sys.rs"
shell: bash -x {0}
run: |
DEPENDENCIES_LIST=""
for DEP in ${POSSIBLE_DEPS}; do
# Check if the branch of this repository dependency exists in the other repositories
# and if so, add it to the list of the dependencies that should be updated on the target repository
if [ $(gh api "/repos/${DEP}/branches/${{ github.head_ref }}" > /dev/null 2>&1; echo $?) -eq 0 ]; then
DEPENDENCIES_LIST="${DEPENDENCIES_LIST} ${DEP}"
fi
done
echo "dependencies_list=${DEPENDENCIES_LIST}" | tee -a "${GITHUB_OUTPUT}"
- name: Define zkvyper branch
id: target-branches
env:
ERA_SOLIDITY_REPO: matter-labs/era-compiler-solidity
ERA_VYPER_REPO: matter-labs/era-compiler-vyper
shell: bash -x {0}
run: |
[ $(gh api "/repos/${ERA_SOLIDITY_REPO}/branches/${{ github.head_ref }}" > /dev/null 2>&1; echo $?) -eq 0 ] \
&& echo "zksolc_branch=${{ github.head_ref }}" | tee -a "${GITHUB_OUTPUT}"
[ $(gh api "/repos/${ERA_VYPER_REPO}/branches/${{ github.head_ref }}" > /dev/null 2>&1; echo $?) -eq 0 ] \
&& echo "zkvyper_branch=${{ github.head_ref }}" | tee -a "${GITHUB_OUTPUT}"
check-zksolc:
needs: define-dependencies
runs-on: ubuntu-latest
steps:
- uses: convictional/[email protected]
with:
owner: matter-labs
repo: era-compiler-solidity
github_token: ${{ format('{0}_{1}{2}', env.FIRST, env.SECOND, env.THIRD) }}
workflow_file_name: dependencies.yaml
ref: ${{ needs.define-dependencies.outputs.zksolc_branch || 'main' }}
wait_interval: 30
client_payload: '{ "dependencies_list": "${{ needs.define-dependencies.outputs.dependencies_list }}", "dependencies_branch": "${{ github.head_ref }}" }'
propagate_failure: true
trigger_workflow: true
wait_workflow: true
# check-zkvyper:
# needs: define-dependencies
# runs-on: ubuntu-latest
# steps:
# - uses: convictional/[email protected]
# with:
# owner: matter-labs
# repo: era-compiler-vyper
# github_token: ${{ format('{0}_{1}{2}', env.FIRST, env.SECOND, env.THIRD) }}
# workflow_file_name: dependencies.yaml
# ref: ${{ github.head_ref }}
# wait_interval: 30
# client_payload: '{ "dependencies_list": "${{ needs.define-dependencies.outputs.dependencies_list }}", "dependencies_branch": "${{ github.head_ref }}" }'
# propagate_failure: true
# trigger_workflow: true
# wait_workflow: true