-
Notifications
You must be signed in to change notification settings - Fork 61
71 lines (57 loc) · 1.7 KB
/
gcp-test.yaml
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
name: gcp-auth-script
on:
push:
branches:
- ci-testing
- main
- release/* #ToDo: add a release branch
pull_request:
workflow_dispatch:
jobs:
activate-vm:
runs-on: ubuntu-latest
steps:
- id: 'auth'
uses: 'google-github-actions/[email protected]'
with:
credentials_json: '${{ secrets.GCP_AUTH }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
with:
version: '>= 363.0.0'
- name: 'Start VM instance'
run: 'gcloud compute instances start demos-tests --zone us-central1-a'
- name: 'SSH into the instance'
run: |
gcloud auth activate-service-account --key-file <(echo ${{ secrets.GCP_AUTH }})
gcloud config set project gpu-insatnce
gcloud config set compute/zone us-central1-a
gcloud compute ssh demos-tests --command "ls"
run-test:
needs: activate-vm
runs-on: self-hosted
steps:
- name: Checkout Demos🛎
uses: actions/checkout@v2
with:
path: demos
persist-credentials: false
submodules: "recursive"
fetch-depth: 1
- name: Run Demo Testing
run: |
echo "testing things out!"
deactivate-vm:
needs: run-test
runs-on: ubuntu-latest
steps:
- id: 'auth'
uses: 'google-github-actions/[email protected]'
with:
credentials_json: '${{ secrets.GCP_AUTH }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
with:
version: '>= 363.0.0'
- name: 'Stop VM instance'
run: 'gcloud compute instances stop demos-tests --zone us-central1-a'