-
Notifications
You must be signed in to change notification settings - Fork 7
103 lines (85 loc) · 2.61 KB
/
test.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
name: Tests
on: [pull_request, push]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
install_and_test:
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os:
- label: Linux
runner: ubuntu-latest
env-file:
- label: Lock File
file: .github/lockfile.lock
- label: Environment File
file: .github/environment.yml
name: Install And Test - ${{ matrix.os.label }} ${{ matrix.env-file.label }}
runs-on: ${{ matrix.os.runner }}
steps:
# Typical github repo checkout step.
- name: Github Repo Checkout
uses: actions/checkout@v3
# Install Python on the runner.
- name: Provision with Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'
# Set the conda environment up using Mamba and install dependencies
- name: Setup Environment
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: ${{ matrix.env-file.file }}
environment-name: RTC
# Install the S1-Reader OPERA-ADT project.
- name: Install S1-Reader
run: |
curl -sSL \
https://github.com/opera-adt/s1-reader/archive/refs/tags/v0.2.2.tar.gz \
-o s1_reader_src.tar.gz \
&& tar -xvf s1_reader_src.tar.gz \
&& ln -s s1-reader-0.2.2 s1-reader \
&& rm s1_reader_src.tar.gz \
&& python -m pip install ./s1-reader
# Setup the project
- name: Install Project
run: python -m pip install .
# Test the project.
- name: Test Project
run: |
pytest -vrpP
build_docker:
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os:
- label: Linux
runner: ubuntu-latest
name: Docker Build Test - ${{ matrix.os.label }}
runs-on: ${{ matrix.os.runner }}
steps:
# Typical github repo checkout step.
- name: Github Repo Checkout
uses: actions/checkout@v3
# Install Python on the runner.
- name: Provision with Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip'
# Install the setuptools dependency for build_docker_image.sh.
- name: Setup Python dependencies
run: pip install setuptools
# Build the image.
- name: Build docker image
run: |
sh build_docker_image.sh