-
Notifications
You must be signed in to change notification settings - Fork 14
78 lines (70 loc) · 3.04 KB
/
test-samples.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
70
71
72
73
74
75
76
77
78
# Workflow to test CDSE notebook samples
name: test-samples
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: test-notebook-samples
# cancel-in-progress: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "test"
test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v3
# Login to CloudFerro Docker registry
- name: Docker Login
uses: docker/login-action@v2.1.0
with:
registry: registry.cloudferro.com
username: ${{ secrets.CF_REGISTRY_USERNAME }}
password: ${{ secrets.CF_REGISTRY_PASSWORD }}
# Specifies whether the given registry is ECR (auto, true or false)
ecr: false
# Log out from the Docker registry at the end of a job
logout: true
- name: Start JupyterLab container
id: start-jupyterlab-container
run: |
chmod -R 0777 $GITHUB_WORKSPACE
container_id=`docker run -v $GITHUB_WORKSPACE:/home/jovyan/samples \
--env="CDSE_USERNAME=${{ secrets.CDSE_USERNAME }}" \
--env="CDSE_PASSWORD=${{ secrets.CDSE_PASSWORD }}" \
--env="SH_CLIENT_ID=${{ secrets.SH_CLIENT_ID }}" \
--env="SH_CLIENT_SECRET=${{ secrets.SH_CLIENT_SECRET }}" \
--env="OPENEO_AUTH_METHOD=client_credentials" \
--env="OPENEO_AUTH_CLIENT_ID=${{ secrets.OPENEO_AUTH_CLIENT_ID }}" \
--env="OPENEO_AUTH_CLIENT_SECRET=${{ secrets.OPENEO_AUTH_CLIENT_SECRET }}" \
--env="OPENEO_AUTH_PROVIDER_ID=CDSE" \
-d --rm registry.cloudferro.com/vito/jupyterhub:rc-92004`
echo Started container ${container_id}
echo Waiting for jupyterlab to start ...
sleep 60
echo "container_id=${container_id}" >> "$GITHUB_ENV"
- name: Run Sentinelhub tests
if: success() || failure()
run: |
$GITHUB_WORKSPACE/.test-samples.sh sentinelhub ${{ env.container_id }}
- name: Run OpenEO tests
if: success() || failure()
run: |
$GITHUB_WORKSPACE/.test-samples.sh openeo ${{ env.container_id }}
- name: Run geo tests
if: success() || failure()
run: |
$GITHUB_WORKSPACE/.test-samples.sh geo ${{ env.container_id }}
- name: Stop JupyterLab container
if: success() || failure()
run: |
docker stop ${{ env.container_id }}