-
Notifications
You must be signed in to change notification settings - Fork 15
109 lines (84 loc) · 3.17 KB
/
collator-selection.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: collator-selection
# Controls when the action will run.
on:
workflow_call:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
#Define Workflow variables
env:
REPO_URL: ${{ github.server_url }}/${{ github.repository }}
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
prepare-execution-marix:
name: Prepare execution matrix
runs-on: [self-hosted]
outputs:
matrix: ${{ steps.create_matrix.outputs.matrix }}
steps:
- name: Clean Workspace
uses: AutoModality/[email protected]
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]
with:
ref: ${{ github.head_ref }} #Checking out head commit
- name: Read .env file
uses: xom9ikk/dotenv@v2
- name: Create Execution matrix
uses: CertainLach/create-matrix-action@v4
id: create_matrix
with:
matrix: |
network {opal}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}
network {quartz}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}
collator-selection:
needs: prepare-execution-marix
# The type of runner that the job will run on
runs-on: [self-hosted]
timeout-minutes: 1380
name: ${{ matrix.network }}
continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.
strategy:
matrix:
include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
steps:
- name: Skip if pull request is in Draft
if: github.event.pull_request.draft == true
run: exit 1
- name: Clean Workspace
uses: AutoModality/[email protected]
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]
with:
ref: ${{ github.head_ref }} #Checking out head commit
# Prepare SHA
- name: Prepare SHA
uses: ./.github/actions/prepare
- name: Read .env file
uses: xom9ikk/dotenv@v2
- name: Log in to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
- name: Check and pull polkadot image
id: polkadot
uses: cloudposse/github-action-docker-image-exists@main
with:
registry: registry.hub.docker.com
organization: parity
repository: polkadot
login: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
tag: ${{ matrix.relay_branch }}
- name: Clean Workspace
if: always()
uses: AutoModality/[email protected]
- name: Remove builder cache
if: always()
run: |
docker system prune -a -f
outputs:
result: ${{ steps.polkadot.outputs.exists }}
result_conclusion: ${{ steps.polkadot.outputs.conclusion }}
image: ${{ steps.polkadot.outputs.image }}
tag: ${{ steps.polkadot.outputs.tag }}