test variables #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | ||