ci: Install Python deps from requirements.txt #42
Workflow file for this run
This file contains 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
on: | |
push: | |
branches: | |
- master | |
- feature/captive-portal-ci | |
pull_request: | |
branches: | |
- master | |
types: [opened, reopened, synchronize] | |
name: ci-master | |
env: | |
NODE_VERSION: 16 | |
PYTHON_VERSION: 3.9 | |
SHOCKLINK_API_DOMAIN: api.shocklink.net | |
SHOCKLINK_FW_VERSION: master-${{ github.sha }} | |
jobs: | |
build-captive-portal: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
sparse-checkout: | | |
WebUI | |
path: . | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: 'npm' | |
cache-dependency-path: ./WebUI/package-lock.json | |
- name: Install dependencies | |
working-directory: ./WebUI | |
run: npm ci | |
- name: Build | |
working-directory: ./WebUI | |
run: npm run build | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: captive-portal | |
path: WebUI/build/* | |
retention-days: 1 | |
if-no-files-found: error | |
build-firmware: | |
runs-on: ubuntu-latest | |
needs: build-captive-portal | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.platformio/platforms | |
~/.platformio/packages | |
~/.platformio/cache | |
key: ${{ runner.os }}-arch | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
cache: "pip" | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Build firmware | |
run: pio run | |
- name: Download built captive portal | |
uses: actions/download-artifact@v3 | |
with: | |
name: captive-portal | |
path: WebUI/build/ | |
- name: Build filesystem | |
run: pio run --target buildfs | |
- name: Upload Firmware Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: firmware | |
path: .pio/build/ShockLink/*.bin | |
retention-days: 1 | |
if-no-files-found: error |