diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..8f99cd21 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,36 @@ +name: Test + +on: + push: + branches: + - "master" + pull_request: + branches: + - "master" + +jobs: + test: + runs-on: ubuntu-latest + defaults: + run: + shell: bash -l {0} + + steps: + - uses: actions/checkout@v2 + + - name: Install Conda environment from environment.yml + uses: mamba-org/provision-with-micromamba@v13 + with: + environment-file: environment.yml + + - name: Install package + run: | + pip install --no-deps . + + - name: Rough CLI test for installed package + run: | + imperics --help + + - name: Test with pytest + run: | + pytest -v -m "not imperics_shareddir" diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 59b5b5e4..00000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,55 +0,0 @@ -image: docker:latest -services: -- docker:dind - -stages: -- build -- test -- release - -variables: - CONTAINER_TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG - CONTAINER_RELEASE_IMAGE_GITLAB: $CI_REGISTRY_IMAGE:latest - CONTAINER_RELEASE_IMAGE_GCR: $GCR_HOST/$GCS_PROJECTID/private/imperics:latest - -before_script: -- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - -build: - stage: build - script: - - docker pull $CI_REGISTRY_IMAGE:latest || true - - docker build --tag $CONTAINER_TEST_IMAGE . - - docker run $CONTAINER_TEST_IMAGE /bin/bash -c 'conda list -n impact-env' - - docker push $CONTAINER_TEST_IMAGE - -test-cli: - stage: test - script: - - docker pull $CONTAINER_TEST_IMAGE - - docker run $CONTAINER_TEST_IMAGE imperics --help - -test-pytest: - stage: test - script: - - docker pull $CONTAINER_TEST_IMAGE - - docker run $CONTAINER_TEST_IMAGE /bin/bash -c 'cd /opt/src/app; pytest -v -m "not imperics_shareddir" /opt/src/app' - -release-docker-gitlab: - stage: release - script: - - docker pull $CONTAINER_TEST_IMAGE - - docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE_GITLAB - - docker push $CONTAINER_RELEASE_IMAGE_GITLAB - only: - - master - -release-docker-google: - stage: release - script: - - docker pull $CONTAINER_TEST_IMAGE - - cat $GCR_KEY | docker login -u _json_key --password-stdin https://$GCR_HOST - - docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE_GCR - - docker push $CONTAINER_RELEASE_IMAGE_GCR - only: - - master