Skip to content

♻️ Split ResourcePool into three classes #71

♻️ Split ResourcePool into three classes

♻️ Split ResourcePool into three classes #71

name: Launch lite regression test
on:
pull_request:
branches:
- develop
types:
- opened
- ready_for_review
- reopened
workflow_call:
secrets:
GH_CLI_BIN_PATH:
description: 'path to directory containing GitHub CLI binary if not on default $PATH'
required: false
SSH_PRIVATE_KEY:
required: true
SSH_USER:
required: true
SSH_HOST:
required: true
SSH_WORK_DIR:
required: true
workflow_dispatch:
jobs:
test:
name: Regression Test - Lite
environment: ACCESS
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_HOST: ${{ secrets.SSH_HOST }}
if: "${{ github.env.SSH_PRIVATE_KEY }} != ''"
runs-on: ubuntu-latest
steps:
- name: Get C-PAC branch
run: |
if [[ ! $GITHUB_REF_NAME == 'main' ]] && [[ ! $GITHUB_REF_NAME == 'develop' ]]
then
TAG=`echo ${GITHUB_REF_NAME} | sed 's/[^a-zA-Z0-9._]/-/g'`
elif [[ $GITHUB_REF_NAME == 'develop' ]]
then
TAG=nightly
elif [[ $GITHUB_REF_NAME == 'main' ]]
then
TAG=latest
fi
TAG=$TAG$VARIANT
echo DOCKER_TAG=$(echo "ghcr.io/${{ github.repository }}" | tr '[:upper:]' '[:lower:]'):$TAG >> $GITHUB_ENV
cat $GITHUB_ENV
- name: Install SSH Keys
run: |
mkdir -p ~/.ssh/
echo "${{ env.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H -t rsa "${{ env.SSH_HOST }}" > ~/.ssh/known_hosts
- name: Initiate check
uses: guibranco/[email protected]
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
context: Launch lite regression test
description: launching
state: pending
- name: Connect and Run Regression Test Lite
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
command_timeout: 200m
script: |
cd ${{ secrets.SSH_WORK_DIR }}
if [ ! -d slurm_testing ] ; then
git clone https://github.com/${{ github.repository_owner }}/slurm_testing slurm_testing
else
cd slurm_testing
git pull origin regression/after_runs
cd ..
fi
mkdir -p ./logs/${{ github.sha }}
sbatch --export="HOME_DIR=${{ secrets.SSH_WORK_DIR }},IMAGE=${{ env.DOCKER_TAG }},OWNER=${{ github.repository_owner }},PATH_EXTRA=${{ secrets.GH_CLI_BIN_PATH }},REPO=$(echo ${{ github.repository }} | cut -d '/' -f 2),SHA=${{ github.sha }}" --output=${{ secrets.SSH_WORK_DIR }}/logs/${{ github.sha }}/out.log --error=${{ secrets.SSH_WORK_DIR }}/logs/${{ github.sha }}/error.log slurm_testing/.github/scripts/launch_regtest_lite.SLURM
- name: Cleanup SSH
run: |
rm -rf ~/.ssh