From 40aae220157df012f328a50331e02100f4f8d110 Mon Sep 17 00:00:00 2001 From: "Kacper Kowalik (Xarthisius)" Date: Wed, 4 Oct 2023 09:50:06 -0500 Subject: [PATCH] ENH: Switch to Github Actions --- .circleci/config.yml | 46 ------------------------------- .github/workflows/build-test.yaml | 44 +++++++++++++++++++++++++++++ tox.ini | 13 +-------- 3 files changed, 45 insertions(+), 58 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/build-test.yaml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index fb42cd1..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,46 +0,0 @@ -version: 2.0 -jobs: - build: - docker: - - image: wholetale/girder:latest - - image: mongo:3.4 - steps: - - checkout - - run: - name: Installing Plugin Dependencies - command: | - apt-get update -qqy - apt-get install -y sudo - rm -rf /girder/plugins/virtual_resources - cp -r /root/project /girder/plugins/virtual_resources - - run: - name: Install Test Dependencies - environment: - - LC_ALL: "C.UTF-8" - command: | - set -o pipefail; cd /girder ; python3 -m pip install -r requirements-dev.txt -e .[plugins,sftp] | cat - set -o pipefail; cd /girder/pytest_girder ; python3 -m pip install . | cat - cp /root/project/setup.cfg /girder/ - mkdir /girder/build - chown -R girder:girder /girder - - run: - name: Running Tests - environment: - - PYTHON_VERSION: "3.9" - - COVERAGE_EXECUTABLE: "/girder/venv/bin/coverage" - - FLAKE8_EXECUTABLE: "/girder/venv/bin/flake8" - - VIRTUALENV_EXECUTABLE: "/girder/venv/bin/virtualenv" - - PYTHON_EXECUTABLE: "/girder/venv/bin/python3" - - TEST_GROUP: "python" - - HOME: "/home/girder" - command: | - sudo -E -u girder ctest -VV -S /girder/plugins/virtual_resources/cmake/circle_continuous.cmake - - run: - name: Install Codecov client - command: python3 -m pip install codecov - - run: - name: Collect coverage reports - command: coverage combine /girder/build/test/coverage/python_temp/ - - run: - name: Uploading Coverage Results - command: codecov diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml new file mode 100644 index 0000000..98c386a --- /dev/null +++ b/.github/workflows/build-test.yaml @@ -0,0 +1,44 @@ +name: Testing and Linting + +on: + push: + branches: + - main + - 3.x-port + pull_request: + workflow_dispatch: + +defaults: + run: + shell: bash + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.11"] + services: + mongodb: + image: mongo:3.6 + ports: + - 27017:27017 + steps: + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Checkout repo + uses: actions/checkout@v3 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install tox + - name: Run Linter + run: tox -e lint -- virtual_resources + - name: Run Tests with coverage + run: tox -e pytest + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/tox.ini b/tox.ini index 1e777c3..fb08e1d 100644 --- a/tox.ini +++ b/tox.ini @@ -5,7 +5,7 @@ envlist = lint,pytest deps = -rrequirements-dev.txt commands = - pytest {posargs} + pytest --cov=virtual_resources --cov-report=xml {posargs} [testenv:lint] skip_install = true @@ -20,17 +20,6 @@ deps = commands = flake8 {posargs} -[testenv:coverage] -skip_install = true -skipsdist = true -deps = - coverage -commands = - coverage combine - coverage report - coverage html - coverage xml - [flake8] max-line-length = 100 show-source = True