-
-
Notifications
You must be signed in to change notification settings - Fork 41
84 lines (78 loc) · 2.83 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
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
jobs:
test:
name: Regression Test - Lite
environment: ACCESS
runs-on: ubuntu-latest
steps:
- name: Get C-PAC branch
run: |
GITHUB_BRANCH=$(echo ${GITHUB_REF} | cut -d '/' -f 3-)
if [[ ! $GITHUB_BRANCH == 'main' ]] && [[ ! $GITHUB_BRANCH == 'develop' ]]
then
TAG=${GITHUB_BRANCH//\//_}
elif [[ $GITHUB_BRANCH == 'develop' ]]
then
TAG=nightly
elif [[ $GITHUB_BRANCH == '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 "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H -t rsa ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
- name: Initiate check
uses: guibranco/github-status-action-v2@v1.1.7
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
context: Launch lite regression test
description: launching
state: pending
- name: Connect and Run Regression Test Lite
uses: appleboy/ssh-action@v1.0.0
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