diff --git a/.github/workflows/build.yml b/.github/workflows/cicd.yml similarity index 62% rename from .github/workflows/build.yml rename to .github/workflows/cicd.yml index 1bcccd458..df2af4dd4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/cicd.yml @@ -1,4 +1,4 @@ -name: Build distribution, test install & push releases to pypi +name: CI/CD on: push: release: @@ -28,29 +28,40 @@ jobs: name: dist path: dist - test-install-py2: - name: ๐Ÿงช Test install on Python 2 - runs-on: ubuntu-latest + test-install: + name: ๐Ÿงช Test install needs: build + strategy: + matrix: + python: ["2.7", "3.7", "3.8"] + installable: ["wheel", "sdist"] + runs-on: ubuntu-latest steps: - name: โฌ‡ Download build result uses: actions/download-artifact@v1 with: name: dist path: dist - - name: ๐Ÿ— Set up Python 2.7 + - name: ๐Ÿ— Set up Python ${{ matrix.python }} uses: actions/setup-python@v1 with: - python-version: 2.7 + python-version: ${{ matrix.python }} - name: ๐Ÿš€ Install wheel + if: matrix.installable == 'wheel' run: | pip install dist/OctoPrint-*-py2.py3-none-any.whl + - name: ๐Ÿš€ Install source tarball + if: matrix.installable == 'sdist' + run: | + pip install dist/OctoPrint-*.tar.gz - test-install-py3: - name: ๐Ÿงช Test install on Python 3 - runs-on: ubuntu-latest - needs: build + test-e2e: + name: ๐Ÿงช Test E2E + runs-on: ubuntu-16.04 steps: + - name: โฌ‡ Checkout code + uses: actions/checkout@v2 + - name: โฌ‡ Download build result uses: actions/download-artifact@v1 with: @@ -64,12 +75,38 @@ jobs: run: | pip install dist/OctoPrint-*-py2.py3-none-any.whl + - name: ๐Ÿ— Create base config for test server + run: | + mkdir e2econfig + cp -r .github/fixtures/with_acl/* e2econfig + + - name: ๐Ÿš€ Run Cypress + uses: cypress-io/github-action@v2 + with: + working-directory: tests/cypress + browser: chrome + start: 'octoprint -b ${{ github.workspace }}/e2econfig serve --host 127.0.0.1 --port 5000' + wait-on: 'http://127.0.0.1:5000/online.txt' + + - name: โฌ† Upload screenshots + uses: actions/upload-artifact@v1 + if: failure() + with: + name: cypress-screenshots + path: tests/cypress/screenshots + - name: โฌ† Upload videos + uses: actions/upload-artifact@v1 + if: always() + with: + name: cypress-videos + path: tests/cypress/videos + publish-on-testpypi: name: ๐Ÿ“ฆ Publish on TestPyPI if: github.event_name == 'release' needs: - - test-install-py2 - - test-install-py3 + - test-install + - test-e2e runs-on: ubuntu-latest steps: - name: โฌ‡ Download build result diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml deleted file mode 100644 index 7e8116012..000000000 --- a/.github/workflows/e2e.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: E2E tests -on: [push] - -jobs: - cypress-run: - runs-on: ubuntu-16.04 - steps: - - name: โฌ‡ Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: ๐Ÿ Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - name: ๐Ÿ‘ท Build and install checkout - run: | - pip install . - - - name: ๐Ÿ— Create base config for test server - run: | - mkdir e2econfig - cp -r .github/fixtures/with_acl/* e2econfig - - - name: ๐Ÿš€ Run Cypress - uses: cypress-io/github-action@v2 - with: - working-directory: tests/cypress - browser: chrome - start: 'octoprint -b ${{ github.workspace }}/e2econfig serve --host 127.0.0.1 --port 5000' - wait-on: 'http://127.0.0.1:5000/online.txt' - - - name: โฌ† Upload screenshots - uses: actions/upload-artifact@v1 - if: failure() - with: - name: cypress-screenshots - path: tests/cypress/screenshots - - name: โฌ† Upload videos - uses: actions/upload-artifact@v1 - if: always() - with: - name: cypress-videos - path: tests/cypress/videos