-
Notifications
You must be signed in to change notification settings - Fork 149
83 lines (75 loc) · 2.52 KB
/
cicd.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
name: Deploy ADL LRS Application (Python)
on:
push:
branches:
- master
- adding-nodejs-tests
jobs:
deploy-staging:
runs-on: ubuntu-latest
environment: staging
steps:
- name: Configure SSH
run: |
echo "Configuring SSH to reach staging instance."
mkdir -p ~/.ssh
echo "${{ secrets.ADLNET_STAGING_SSH_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan "${{ secrets.ADLNET_STAGING_HOST }}" >> ~/.ssh/known_hosts
- name: Deploy code on Staging
run: |
echo "SSH into staging machine."
ssh ${{ secrets.ADLNET_STAGING_HOST_USER }}@${{ secrets.ADLNET_STAGING_HOST }} "
cd ${{ secrets.ADLNET_STAGING_PROJECT_DIR }}
echo 'Pulling Latest Code from Repository...'
git pull
echo 'Rebuilding Docker Containers..'
sudo docker-compose stop
sudo docker-compose build --no-cache
sudo docker-compose up -d
echo 'deployed successfully on server' "
- name: Check the deployed service URL
uses: jtalk/url-health-check-action@v4
with:
url: ${{ secrets.ADLNET_STAGING_HOST }}
max-attempts: 10
retry-delay: 10s
cypress-testing:
name: Cypress run
environment: staging
needs:
- deploy-staging
runs-on: ubuntu-22.04
env:
LRS_USERNAME: ${{ secrets.ADLNET_STAGING_LRS_USERNAME }}
LRS_PASSWORD: ${{ secrets.ADLNET_STAGING_LRS_PASSWORD }}
LRS_HOST_URL: ${{ secrets.ADLNET_STAGING_LRS_HOST_URL }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cypress run
uses: cypress-io/github-action@v6
with:
working-directory: ./tests/cypress
conformance-testing:
runs-on: ubuntu-latest
environment: staging
needs:
- deploy-staging
steps:
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Clone the CTS Repo
uses: GuillaumeFalourd/clone-github-repo-action@main
with:
owner: adlnet
repository: lrs-conformance-test-suite
depth: 1
branch: master
- name: Run LRS Conformance Suite
run: |
cd lrs-conformance-test-suite
npm install
node ./bin/console_runner.js --basicAuth --authUser ${{ secrets.ADLNET_STAGING_LRS_USERNAME }} --authPassword ${{ secrets.ADLNET_STAGING_LRS_PASSWORD }} --endpoint ${{ secrets.ADLNET_STAGING_LRS_ENDPOINT }}