This repository has been archived by the owner on Dec 5, 2024. It is now read-only.
Archiving the project (#179) #785
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |