diff --git a/.github/workflows/release.yml b/.github/workflows/ci.yml similarity index 95% rename from .github/workflows/release.yml rename to .github/workflows/ci.yml index 0d15af43..1cd190ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/ci.yml @@ -2,10 +2,10 @@ name: Release on: push: - branches: [deploy/release] + branches: [master,develop,deploy/release] jobs: - jest-tests: + jest: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -23,7 +23,7 @@ jobs: - name: Submit to Codecov uses: codecov/codecov-action@v1 - tox-tests: + tox: strategy: fail-fast: false @@ -74,9 +74,11 @@ jobs: - uses: codecov/codecov-action@v1 if: ${{ matrix.coverage }} - build-and-push-docker-image: + deploy: name: Build and publish to PyPi and DockerHub runs-on: ubuntu-latest + needs: [jest-tests, tox-tests] + if: github.ref == 'refs/heads/deploy/release' steps: - name: Checkout code diff --git a/.github/workflows/jest-tests.yml b/.github/workflows/jest-tests.yml deleted file mode 100644 index e3d01975..00000000 --- a/.github/workflows/jest-tests.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Jest tests - -on: - - push - - pull_request - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: '12' - - name: Install modules - run: npm ci - - name: Run tests - env: - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - run: npm run test - - name: Submit to Codecov - uses: codecov/codecov-action@v1 \ No newline at end of file diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml deleted file mode 100644 index d00dd425..00000000 --- a/.github/workflows/python-tests.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Python tests - -on: - - push - - pull_request - -jobs: - main: - strategy: - fail-fast: false - matrix: - include: - - name: "Test: Python 3.7" - python: "3.7" - tox: py37 - coverage: true - - name: "Test: Python 3.8" - python: "3.8" - tox: py38 - - name: "Test: Python 3.9" - python: "3.9" - tox: py39 - - 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 }} \ No newline at end of file