Skip to content

CI

CI #604

Workflow file for this run

---
name: CI
on:
push:
paths-ignore:
- "book/"
- "book/**"
- "**/README.md"
- ".github/workflows/wokwi_projects.yml"
pull_request:
paths-ignore:
- "book/"
- "book/**"
- "**/README.md"
- ".github/workflows/wokwi_projects.yml"
schedule:
- cron: "50 7 * * *"
jobs:
build-examples:
name: Build ${{ matrix.project.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
project:
- name: "button-interrupt"
path: "advanced/button-interrupt"
- name: "i2c-driver"
path: "advanced/i2c-driver"
- name: "i2c-sensor-reading"
path: "advanced/i2c-sensor-reading"
- name: "hardware-check"
path: "intro/hardware-check"
- name: "http-client"
path: "intro/http-client"
- name: "http-server"
path: "intro/http-server"
- name: "mqtt"
path: "intro/mqtt/exercise"
- name: "mqtt - host client"
path: "intro/mqtt/host-client"
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Update ownership
run: |
sudo chown 1000:1000 -R ${{ github.workspace }}
- name: Build Docker image
if: github.event_name != 'schedule'
uses: docker/build-push-action@v5
with:
context: .
tags: espressif/rust-std-training
file: .devcontainer/Dockerfile
push: false
- name: Pull Docker image
if: github.event_name == 'schedule'
run: docker image pull espressif/rust-std-training
- name: Test code example in Docker image
uses: addnab/docker-run-action@v3
with:
image: espressif/rust-std-training:latest
options: -u esp -v ${{ github.workspace }}:/home/esp/workspace
run: /bin/bash /home/esp/workspace/.devcontainer/test.sh ${{ matrix.project.path }}
- name: Wokwi CI check
if: (matrix.project.name == 'button-interrupt' || matrix.project.name == 'http-client' || matrix.project.name == 'hardware-check') && github.actor == 'esp-rs'
uses: wokwi/wokwi-ci-action@v1
with:
token: ${{ secrets.WOKWI_CLI_TOKEN }}
path: ${{ matrix.project.path }}
timeout: 30000
scenario: ${{ github.workspace }}/.github/${{ matrix.project.name }}.test.yaml
fail_text: 'Error'