This repository has been archived by the owner on Dec 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
159 lines (142 loc) · 4.63 KB
/
main.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: CI shared
on:
push:
branches:
- main
pull_request:
branches:
- main
defaults:
run:
shell: bash -l {0}
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: test
steps:
- uses: actions/checkout@v2
- name: install mamba
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: environment.yml
condarc-file: .condarc
- name: configure powerloader build
if: runner.os != 'Windows'
shell: bash -l {0}
run: |
mkdir build; cd build
export USE_ZCHUNK=ON
cmake .. \
-GNinja \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DWITH_ZCHUNK=$USE_ZCHUNK \
-DBUILD_SHARED=ON \
-DENABLE_TESTS=ON \
-DBUILD_EXE=ON
- name: configure powerloader build
if: runner.os == 'Windows'
shell: cmd /C CALL {0}
run: |
call activate powerloader
echo %CONDA_PREFIX%
echo %PATH%
mkdir build
cd build
cmake .. -DCMAKE_PREFIX_PATH=%CONDA_PREFIX%\Library ^
-DENABLE_TESTS=ON ^
-DWITH_ZCHUNK=OFF ^
-DBUILD_SHARED=ON ^
-DBUILD_EXE=ON ^
-G "Ninja"
- name: build powerloader
if: runner.os != 'Windows'
shell: bash -l {0}
run: |
cd build
ninja
- name: build powerloader
if: runner.os == 'Windows'
shell: cmd /C CALL {0}
run: |
call activate powerloader
cd build
ninja
- name: run powerloader tests
if: runner.os != 'Windows'
shell: bash -l {0}
run: |
cd build
ninja test
- name: run powerloader tests
if: runner.os == 'Windows'
shell: cmd /C CALL {0}
run: |
call activate powerloader
cd build
ninja test
- name: Download test packages
shell: bash -l -eo pipefail {0}
if: runner.os != 'Windows'
run: |
server_path="test/conda_mock/static/packages"
build/powerloader download -f test/remote_mirrors.yml -d $server_path
- name: Setup minio and oras
env:
AWS_S3_BUCKET: testbucket
AWS_ACCESS_KEY_ID: minioadmin
AWS_SECRET_ACCESS_KEY: minioadmin
AWS_S3_ENDPOINT: http://127.0.0.1:9000
AWS_EC2_METADATA_DISABLED: true
if: runner.os == 'Linux'
run: |
sudo docker run -d -p 9000:9000 --name minio \
-e MINIO_ACCESS_KEY=$AWS_ACCESS_KEY_ID \
-e MINIO_SECRET_KEY=$AWS_SECRET_ACCESS_KEY \
-v /tmp/data:/data \
-v /tmp/config:/root/.minio \
minio/minio server /data
# Populate minIO
# https://docs.min.io/docs/aws-cli-with-minio.html
server_path="test/conda_mock/static/packages"
aws --endpoint-url $AWS_S3_ENDPOINT s3 mb s3://testbucket
aws --endpoint-url $AWS_S3_ENDPOINT \
s3 cp $server_path/xtensor-0.23.9-hc021e02_1.tar.bz2 s3://testbucket/
# Create mock_artifact file
mkdir test/tmp
echo "artifact" > test/tmp/mock_artifact
- name: Python based tests that require secrets
shell: bash -l -eo pipefail {0}
if: runner.os == 'Linux' && github.event_name != 'pull_request'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
GHA_PAT: ${{ secrets.GITHUB_TOKEN }}
GHA_USER: mamba-org
run: |
# Run tests
pytest ./test/test_s3main_branch.py
- name: Run python based tests
shell: bash -l -eo pipefail {0}
env:
AWS_S3_BUCKET: testbucket
AWS_ACCESS_KEY_ID: minioadmin
AWS_SECRET_ACCESS_KEY: minioadmin
AWS_DEFAULT_REGION: eu-central-1
AWS_S3_ENDPOINT: http://127.0.0.1:9000
AWS_EC2_METADATA_DISABLED: true
if: runner.os == 'Linux'
run: |
pytest ./test/test_other.py
pytest ./test/test_oci_registry.py
pytest ./test/test_s3mock.py
- name: Run python based tests for OSX
shell: bash -l -eo pipefail {0}
if: runner.os == 'macOS'
run: |
pytest ./test/test_other.py
pytest ./test/test_oci_registry.py