Merge pull request #294 from geonnave/gateway-schedule-flag #1046
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: | |
| flags: python | |
| verbose: true | |
| control_loop: | |
| name: check custom control loop | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Checkout DotBot-libs repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: DotBots/DotBot-libs | |
| path: DotBot-libs | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Build control loop library | |
| run: | | |
| cmake -DDOTBOT_LIBS_DIR=${PWD}/DotBot-libs -S utils/control_loop -B build | |
| cmake --build build | |
| - name: Check the simulator geometry against the compiled library | |
| run: | | |
| python -m pip install --upgrade --requirement tests_requirements.txt | |
| tox -e tests -- dotbot/tests/test_control_loop_geometry.py | |
| 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 | |
| - run: npm run lint | |
| working-directory: ./dotbot/frontend | |
| - run: npm run typecheck | |
| working-directory: ./dotbot/frontend | |
| - run: npm run test | |
| working-directory: ./dotbot/frontend | |
| - run: npm run build | |
| working-directory: ./dotbot/frontend | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| flags: frontend | |
| verbose: true | |
| - name: Upload frontend build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: frontend | |
| path: ./dotbot/frontend/build | |
| console: | |
| name: check console | |
| 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/console-web | |
| - run: npm run lint | |
| working-directory: ./dotbot/console-web | |
| - run: npm run typecheck | |
| working-directory: ./dotbot/console-web | |
| - run: npm run test | |
| working-directory: ./dotbot/console-web | |
| - run: npm run build | |
| working-directory: ./dotbot/console-web | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| flags: console | |
| verbose: true | |
| - name: Upload console build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: console | |
| path: ./dotbot/console-web/dist | |
| package: | |
| needs: [test, doc, frontend, console, control_loop] | |
| 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 | |
| - 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: Check package data files | |
| run: python utils/check_wheel_contents.py | |
| - name: Upload source package as artifact | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sdist | |
| path: ./dist/*.tar.gz | |
| release: | |
| needs: [package] | |
| 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: 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 }} |