-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e452e8c
commit ad7de89
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
name: CI | ||
|
||
on: | ||
schedule: | ||
- cron: "50 7 * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
wokwi-check: | ||
name: ${{ matrix.project.name }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
project: | ||
- name: "hardware-check" | ||
id: "360342886675214337" | ||
- name: http-client | ||
id: "333372159510446675" | ||
- name: button-interrupt | ||
id: "333374799393849940" | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download project code | ||
run: | | ||
wget -q -O ${{ matrix.project.name }}.zip https://wokwi.com/api/projects/${{ matrix.project.id }}/zip | ||
unzip ${{ matrix.project.name }}.zip -d ${{ matrix.project.name }} | ||
- name: Create wokwi.toml | ||
run: echo -e "[wokwi]\nversion = 1\nfirmware = '${{ matrix.project.name }}'\nelf = '${{ matrix.project.name }}'" > ${{ matrix.project.name }}/wokwi.toml | ||
|
||
- name: Update ownership | ||
run: | | ||
sudo chown 1000:1000 -R ${{ matrix.project.name }} | ||
- name: Pull Docker image | ||
run: docker image pull espressif/rust-std-training | ||
|
||
- name: Test code example in Docker image | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: wokwi/builder-rust-${{ matrix.project.env }}-esp | ||
options: -u esp -v ${{ github.workspace }}:/home/esp/workspace | ||
run: | | ||
. /home/esp/export-esp.sh | ||
cp /home/esp/workspace/${{ matrix.project.name }}/*.rs ${{ matrix.project.name }}/src/ | ||
cd ${{ matrix.project.name }} | ||
cargo build --release --out-dir /home/esp/workspace/${{ matrix.project.name }} -Z unstable-options | ||
- name: Wokwi CI check | ||
uses: wokwi/wokwi-ci-action@v1 | ||
with: | ||
token: ${{ secrets.WOKWI_CLI_TOKEN }} | ||
path: ${{ matrix.project.name }} | ||
timeout: 30000 | ||
scenario: ${{ github.workspace }}/.github/${{ matrix.project.name }}.test.yaml | ||
fail_text: 'Error' | ||
|
||
- name: Upload source code | ||
if: success() || failure() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.project.name }}_${{ matrix.project.id }} | ||
path: ${{ matrix.project.name }} |