-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (127 loc) · 4.05 KB
/
on-push.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: on-push
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: pre-commit/[email protected]
unit-tests:
name: unit-tests (3.10)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download CDM tables
uses: actions/checkout@v3
with:
repository: ecmwf-projects/cdm-obs.git
ref: 'new-variables'
path: common_data_model
- name: Deploy test ingestion database
env:
TEST_INGESTION_DB_PASS: ${{ secrets.TEST_INGESTION_DB_PASS }}
CATALOGUE_PASSWORD: ${{ secrets.CATALOGUE_PASSWORD}}
STORAGE_PASSWORD: ${{ secrets.STORAGE_PASSWORD}}
STORAGE_SECRET_KEY: ${{ secrets.STORAGE_SECRET_KEY}}
timeout-minutes: 2
run: |
cd tests/docker/
wget -nv -O docker-entrypoint-initdb.d/test_ingestiondb.sql https://cloud.predictia.es/s/R9a6z8fBZQcPrAQ/download
touch .env
echo TEST_INGESTION_DB_PASS=$TEST_INGESTION_DB_PASS >> .env
echo CATALOGUE_PASSWORD=$CATALOGUE_PASSWORD >> .env
echo STORAGE_PASSWORD=$STORAGE_PASSWORD >> .env
docker compose up -d
until pg_isready -U user -d baron -p 25432 -h localhost; do sleep 2; done
- name: Download test netCDFs
timeout-minutes: 2
run: |
cd tests/data
wget -nv -O test_netcdfs.tar.gz https://cloud.predictia.es/s/7QzpBEaYyiZ3o6C/download
mkdir cuon_data && tar xzf test_netcdfs.tar.gz -C cuon_data/
rm test_netcdfs.tar.gz
- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
environment-name: DEVELOP
channels: conda-forge
cache-env: true
extra-specs: |
python=3.10
- name: Install package
run: |
python -m pip install --no-deps -e .
- name: Run tests
env:
TEST_INGESTION_DB_PASS: ${{ secrets.TEST_INGESTION_DB_PASS }}
STORAGE_PASSWORD: ${{ secrets.STORAGE_PASSWORD}}
CATALOGUE_DB: ${{ secrets.CATALOGUE_DB}}
CATALOGUE_HOST: ${{ secrets.CATALOGUE_HOST}}
CATALOGUE_PASSWORD: ${{ secrets.CATALOGUE_PASSWORD}}
CATALOGUE_PORT: ${{ secrets.CATALOGUE_PORT}}
CATALOGUE_USER: ${{ secrets.CATALOGUE_USER}}
STORAGE_ACCESS_KEY: ${{ secrets.STORAGE_ACCESS_KEY}}
STORAGE_HOST: ${{ secrets.STORAGE_HOST}}
STORAGE_PORT: ${{ secrets.STORAGE_PORT}}
STORAGE_SECRET_KEY: ${{ secrets.STORAGE_SECRET_KEY}}
STORAGE_SECURE: ${{ secrets.STORAGE_SECURE}}
CDM_TABLES_LOCATION: ${{ github.workspace }}
run: |
ls ${GITHUB_WORKSPACE}/common_data_model/*
make unit-tests COV_REPORT=xml
type-check:
needs: [unit-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
environment-name: DEVELOP
channels: conda-forge
cache-env: true
extra-specs: |
python=3.10
- name: Install package
run: |
python -m pip install --no-deps -e .
- name: Run code quality checks
run: |
make type-check
docs-build:
needs: [unit-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
environment-name: DEVELOP
channels: conda-forge
cache-env: true
extra-specs: |
python=3.10
- name: Install package
run: |
python -m pip install --no-deps -e .
- name: Build documentation
run: |
make docs-build