-
-
Notifications
You must be signed in to change notification settings - Fork 41
88 lines (82 loc) · 2.94 KB
/
regression_test_lite.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
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=${GITHUB_REF_NAME//\//_}
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