Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions .github/workflows/cd-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ on:
description: Value `true` will skip version checks, use for testing or in nightly builds.
type: boolean
required: false
ref_name:
type: string
description: Git branch or tag name to checkout.
default: ${{ github.ref_name }}
required: false

jobs:
setup:
runs-on: ubuntu-latest
Expand All @@ -23,8 +29,11 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref_name }}
fetch-depth: "0"

- name: Get checked out SHA
id: checked_out_sha
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Test tag name pattern
if: ${{ ! inputs.skip_checks }}
shell: python
Expand All @@ -33,7 +42,7 @@ jobs:
import sys

tag_pattern = r"${{ vars.TAG_REGEX_FOR_DEPLOYMENT }}"
ref = "${{ github.ref_name }}"
ref = "${{ inputs.ref_name }}"

if not tag_pattern:
sys.exit(0)
Expand All @@ -45,12 +54,13 @@ jobs:
- name: Test branch name pattern
if: ${{ ! inputs.skip_checks && vars.BRANCH_REGEX_FOR_DEPLOYMENT != '' }}
run: |
git branch --all --list --format "%(refname:lstrip=-1)" --contains "${{ github.ref_name }}" | grep -E "${{ vars.BRANCH_REGEX_FOR_DEPLOYMENT }}"
git branch --all --list --format "%(refname:lstrip=-1)" --contains "${{ inputs.ref_name }}" | grep -E "${{ vars.BRANCH_REGEX_FOR_DEPLOYMENT }}"

- name: Setup Matrix
id: matrix
shell: python
env:
CHECKED_OUT_SHA: ${{ steps.checked_out_sha.outputs.sha }}
MATRIX: |
name:
- gnu-12.2.0
Expand Down Expand Up @@ -118,7 +128,7 @@ jobs:

owner_repo = "${{ github.repository }}"
owner, repo = owner_repo.split("/")
ref = "${{ github.sha }}"
ref = os.getenv("CHECKED_OUT_SHA")
token = "${{ github.token }}"
url = f"https://raw.githubusercontent.com/{owner}/{repo}/{ref}/{input_config_path}"
response = requests.get(url, headers={"Authorization": f"token {token}"})
Expand All @@ -144,7 +154,7 @@ jobs:
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup.outputs.matrix) }}
runs-on: [self-hosted, linux, hpc]
runs-on: [self-hosted, linux, hpc-dev]
env:
GITHUB_TOKEN: ${{ secrets.GH_REPO_READ_TOKEN }}
steps:
Expand All @@ -153,5 +163,5 @@ jobs:
github_user: ${{ secrets.BUILD_PACKAGE_HPC_GITHUB_USER }}
github_token: ${{ secrets.GH_REPO_READ_TOKEN }}
troika_user: ${{ secrets.HPC_CI_SSH_USER }}
repository: ${{ github.repository }}@${{ github.event.pull_request.head.sha || github.sha }}
repository: ${{ github.repository }}@${{ inputs.ref_name }}
build_config: ${{ inputs.config_path }}