Lh2 on dotbot #557
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '*' | |
| pull_request: | |
| jobs: | |
| test: | |
| name: test (${{ matrix.os }}, python-${{ matrix.python-version }}, node-${{ matrix.node-version }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-latest | |
| - windows-latest | |
| python-version: ["3.12"] | |
| node-version: ["20"] | |
| include: | |
| - os: ubuntu-latest | |
| python-version: "3.11" | |
| node-version: "18" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Set up nodejs ${{ matrix.node-version }} | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Install dependencies | |
| run: python -m pip install --upgrade --requirement tests_requirements.txt | |
| - name: Run tox | |
| run: tox | |
| - name: Check cli | |
| if: matrix.os == 'ubuntu-latest' | |
| run: tox -e cli | |
| - name: Upload coverage to Codecov | |
| if: >- | |
| matrix.python-version == 3.12 && | |
| matrix.node-version == 20 | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| verbose: true | |
| doc: | |
| name: check documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install tox | |
| run: python -m pip install --upgrade --requirement tests_requirements.txt | |
| - name: Build and check documentation | |
| run: tox -e doc | |
| frontend: | |
| name: check frontend | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up nodejs | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - run: npm install | |
| working-directory: ./dotbot/frontend | |
| # Disable this step for now because the tests are outdated | |
| # - run: npm run test | |
| # working-directory: ./dotbot/frontend | |
| - run: npm run lint | |
| working-directory: ./dotbot/frontend | |
| - run: npm run build | |
| working-directory: ./dotbot/frontend | |
| - name: Upload frontend build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: frontend | |
| path: ./dotbot/frontend/build | |
| package: | |
| needs: [test, doc, frontend] | |
| name: build source package | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade --requirement tests_requirements.txt | |
| python -m pip install --upgrade --requirement build_requirements.txt | |
| - name: Set up nodejs | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Build package | |
| run: python -m build | |
| - name: Check package | |
| run: twine check dist/* | |
| - name: Upload source package as artifact | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sdist | |
| path: ./dist/*.tar.gz | |
| wheels: | |
| needs: [test, frontend] | |
| name: build wheels | |
| if: github.event_name == 'push' | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-latest | |
| - windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| if: matrix.os != 'macos-latest' | |
| with: | |
| python-version: "3.12" | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| if: matrix.os == 'macos-latest' | |
| with: | |
| python-version: "3.8" | |
| - name: Install build dependencies | |
| run: python -m pip install --upgrade --requirement build_requirements.txt | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: frontend | |
| path: ./dotbot/frontend/build | |
| - name: Build wheels | |
| run: python -m cibuildwheel --output-dir dist | |
| env: | |
| CIBW_SKIP: "cp36-* cp37-* pp*" | |
| CIBW_BUILD_FRONTEND: "build" | |
| - name: Upload wheels as artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-${{ matrix.os }} | |
| path: ./dist/*.whl | |
| release: | |
| needs: [package, wheels] | |
| name: publish release | |
| if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download sdist | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: sdist | |
| path: ./dist | |
| - name: Download ubuntu wheels | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: wheels-ubuntu-latest | |
| path: ./dist | |
| - name: Download mac-os wheels | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: wheels-macos-latest | |
| path: ./dist | |
| - name: Download ubuntu wheels | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: wheels-windows-latest | |
| path: ./dist | |
| - name: Check dist/ content | |
| run: ls -lR ./dist | |
| - name: Publish package to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.pypi_password }} | |
| - name: Release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| generateReleaseNotes: true | |
| artifacts: "dist/*.tar.gz,dist/*.whl" | |
| token: ${{ secrets.RELEASE_TOKEN }} |