discovery tools #28
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 Web | |
| on: | |
| pull_request: | |
| paths: | |
| - web/** | |
| push: | |
| paths: | |
| - web/** | |
| workflow_dispatch: | |
| paths: | |
| - web/** | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| TESTING: 1 | |
| TMPDIR: /tmp/ | |
| PIO_EXECUTABLE: pio | |
| PIOS_EXECUTABLE: pios | |
| DOT_PIOREACTOR: .pioreactor/ | |
| WWW: web/ | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| os: ["ubuntu-latest"] | |
| python-version: ["3.11"] | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v4 | |
| - name: Setup python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install python libraries | |
| run: | | |
| make install | |
| - name: Mosquitto MQTT Broker in GitHub Actions | |
| uses: Namoshek/mosquitto-github-action@v1 | |
| with: | |
| version: '1.6' | |
| - name: Create pioreactor folders and env | |
| run: | | |
| mkdir -p .pioreactor/storage | |
| mv config.dev.ini .pioreactor/config.ini | |
| mkdir -p /tmp/pioreactor_cache/ | |
| mv web/.env.example web/.env | |
| - name: Create plugin folder and seed it | |
| run: | | |
| mkdir -p plugins_dev | |
| cat <<EOT >> plugins_dev/example_plugin.py | |
| import click | |
| from pioreactor.background_jobs.base import BackgroundJob | |
| __plugin_version__ = "0.2.0" | |
| __plugin_name__ = "my-example-plugin" | |
| class ExamplePlugin(BackgroundJob): | |
| job_name="example_plugin" | |
| def __init__(self): | |
| super().__init__(unit="test", experiment="test") | |
| @click.command(name="example_plugin") | |
| def click_example_plugin(): | |
| job = ExamplePlugin() | |
| EOT | |
| - name: Run tests | |
| run: | | |
| make web-test |