-
Notifications
You must be signed in to change notification settings - Fork 140
78 lines (72 loc) · 2.91 KB
/
compatibility-check.yml
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
name: BackwardCompatibilityCheck
on:
workflow_dispatch:
inputs:
repo:
description: Repository (defaults to 'onflow/cadence')
branch:
description: 'Current branch/tag'
required: true
default: 'master'
base:
description: 'Base branch/tag'
required: true
default: 'latest'
pull_request:
branches:
# `feature/**` branches are not included because we would also develop breaking changes
# (large features in particular) in their own feature branches, other than the stable-cadence branch.
# Feature branches would get checked when they are going to get merged into the `master` anyway.
- master
- 'v**'
env:
GO_VERSION: '1.19.2'
concurrency:
group: ${{ github.workflow }}-${{ inputs.base || github.run_id }}
cancel-in-progress: true
jobs:
setup:
runs-on: ubuntu-latest
outputs:
# Map step output to the job output, so that next job can use these values.
repo: ${{ steps.setup.outputs.repo }}
branch: ${{ steps.setup.outputs.branch }}
base: ${{ steps.setup.outputs.base }}
steps:
- name: Setup
id: setup
# If the workflow is running on a pull request, then take the PR's source branch as the current branch,
# and the PR's target as the base branch.
#
# When getting the PR's source branch, Use the commit hash ('github.event.pull_request.head.sha'),
# instead of the branch name, since 'go get' command does not support all kinds of branch names.
#
# Here there also is a limitation that we can't use the 'merge-branch' because it is not visible to 'go get'.
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "repo=`(echo "${{ github.event.pull_request.head.repo.full_name }}")`" >> $GITHUB_OUTPUT
echo "branch=`(echo "${{ github.event.pull_request.head.sha }}")`" >> $GITHUB_OUTPUT
echo "base=`(echo "${{ github.base_ref }}")`" >> $GITHUB_OUTPUT
else
echo "repo=`(echo "${{ inputs.repo || 'onflow/cadence' }}")`" >> $GITHUB_OUTPUT
echo "branch=`(echo "${{ inputs.branch }}")`" >> $GITHUB_OUTPUT
echo "base=`(echo "${{ inputs.base }}")`" >> $GITHUB_OUTPUT
fi
mainnet:
needs: setup
uses: ./.github/workflows/compatibility-check-template.yml
with:
repo: ${{ needs.setup.outputs.repo }}
base-branch: ${{ needs.setup.outputs.base }}
current-branch: ${{ needs.setup.outputs.branch }}
chain: flow-mainnet
url: access.mainnet.nodes.onflow.org:9000
testnet:
needs: setup
uses: ./.github/workflows/compatibility-check-template.yml
with:
repo: ${{ needs.setup.outputs.repo }}
base-branch: ${{ needs.setup.outputs.base }}
current-branch: ${{ needs.setup.outputs.branch }}
chain: flow-testnet
url: access.testnet.nodes.onflow.org:9000