From f3394ec5063a77752b00a87f3d706028f692272a Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Fri, 1 Jan 2021 19:20:00 +0100 Subject: [PATCH] Switch from CircleCI to GitHub Actions --- .circleci/config.yml | 54 ---------------------------------------- .github/workflows/ci.yml | 52 ++++++++++++++++++++++++++++++++++++++ MANIFEST.in | 1 - README.rst | 6 ++--- 4 files changed, 55 insertions(+), 58 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/ci.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 5e86791..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,54 +0,0 @@ -version: 2.1 - -orbs: - codecov: codecov/codecov@1.0.5 - -workflows: - version: 2 - test: - jobs: - - py39 - - py38 - - py37 - - check-manifest - - flake8 - -jobs: - py39: &test-template - docker: - - image: mopidy/ci-python:3.9 - steps: - - checkout - - restore_cache: - name: Restoring tox cache - key: tox-v1-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.cfg" }} - - run: - name: Run tests - command: | - tox -e $CIRCLE_JOB -- \ - --junit-xml=test-results/pytest/results.xml \ - --cov-report=xml - - save_cache: - name: Saving tox cache - key: tox-v1-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.cfg" }} - paths: - - ./.tox - - ~/.cache/pip - - codecov/upload: - file: coverage.xml - - store_test_results: - path: test-results - - py38: - <<: *test-template - docker: - - image: mopidy/ci-python:3.8 - - py37: - <<: *test-template - docker: - - image: mopidy/ci-python:3.7 - - check-manifest: *test-template - - flake8: *test-template diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a71c8e2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,52 @@ +name: CI + +on: [push, pull_request] + +jobs: + main: + strategy: + fail-fast: false + matrix: + include: + - name: "Test: Python 3.7" + python: "3.7" + tox: py37 + - name: "Test: Python 3.8" + python: "3.8" + tox: py38 + - name: "Test: Python 3.9" + python: "3.9" + tox: py39 + coverage: true + - name: "Lint: check-manifest" + python: "3.9" + tox: check-manifest + - name: "Lint: flake8" + python: "3.9" + tox: flake8 + + name: ${{ matrix.name }} + runs-on: ubuntu-20.04 + container: ghcr.io/mopidy/ci:latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - name: Fix home dir permissions to enable pip caching + run: chown -R root /github/home + - name: Cache pip + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-${{ matrix.python }}-${{ matrix.tox }}-pip-${{ hashFiles('setup.cfg') }}-${{ hashFiles('tox.ini') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.python }}-${{ matrix.tox }}-pip- + - run: python -m pip install pygobject tox + - run: python -m tox -e ${{ matrix.tox }} + if: ${{ ! matrix.coverage }} + - run: python -m tox -e ${{ matrix.tox }} -- --cov-report=xml + if: ${{ matrix.coverage }} + - uses: codecov/codecov-action@v1 + if: ${{ matrix.coverage }} diff --git a/MANIFEST.in b/MANIFEST.in index a4203b7..ee8b138 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,7 +6,6 @@ include MANIFEST.in include pyproject.toml include tox.ini -recursive-include .circleci * recursive-include .github * include mopidy_*/ext.conf diff --git a/README.rst b/README.rst index 342de08..8054fe6 100644 --- a/README.rst +++ b/README.rst @@ -6,9 +6,9 @@ Mopidy-SoundCloud :target: https://pypi.org/project/Mopidy-SoundCloud/ :alt: Latest PyPI version -.. image:: https://img.shields.io/circleci/build/gh/mopidy/mopidy-soundcloud - :target: https://circleci.com/gh/mopidy/mopidy-soundcloud - :alt: CircleCI build status +.. image:: https://img.shields.io/github/workflow/status/mopidy/mopidy-soundcloud/CI + :target: https://github.com/mopidy/mopidy-soundcloud/actions + :alt: CI build status .. image:: https://img.shields.io/codecov/c/gh/mopidy/mopidy-soundcloud :target: https://codecov.io/gh/mopidy/mopidy-soundcloud