Skip to content

Commit

Permalink
ci: Update path
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioGasquez committed Nov 9, 2023
1 parent dd56f4f commit 6339c37
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/wokwi_projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@ jobs:
project:
- name: "hardware-check"
id: "360342886675214337"
path: "intro/hardware-check"
- name: http-client
id: "333372159510446675"
path: "intro/http-client"
arg: --example http_client
- name: button-interrupt
id: "333374799393849940"
path: "advanced/button-interrupt"
arg: --example solution

steps:
- name: Checkout the repository
uses: actions/checkout@v4
Expand All @@ -35,14 +41,17 @@ jobs:
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 }}
mkdir -p ${{ matrix.project.name }}/src
cp ${{ matrix.project.name }}/*.rs ${{ matrix.project.name }}/src/
rm -rf ${{ matrix.project.path }}/src/*.rs
cp ${{ matrix.project.name }}/*.rs ${{ matrix.project.path }}/src/
rm -rf ${{ matrix.project.path }}/Cargo.toml
cp ${{ matrix.project.name }}/Cargo.toml ${{ matrix.project.path }}/Cargo.toml
- name: Create wokwi.toml
run: echo -e "[wokwi]\nversion = 1\nfirmware = '${{ matrix.project.name }}'\nelf = '${{ matrix.project.name }}'" > ${{ matrix.project.name }}/wokwi.toml
run: echo -e "[wokwi]\nversion = 1\nfirmware = '${{ matrix.project.name }}'\nelf = '${{ matrix.project.name }}'" > ${{ matrix.project.path }}/wokwi.toml

- name: Update ownership
run: |
sudo chown 1000:1000 -R ${{ matrix.project.name }}
sudo chown 1000:1000 -R ${{ matrix.project.path }}
- name: Pull Docker image
run: docker image pull espressif/rust-std-training
Expand All @@ -53,8 +62,9 @@ jobs:
image: espressif/rust-std-training:latest
options: -u esp -v ${{ github.workspace }}:/home/esp/workspace
run: |
cd /home/esp/workspace/${{ matrix.project.name }}
/home/esp/.cargo/bin/cargo build --release --out-dir /home/esp/workspace/${{ matrix.project.name }} -Z unstable-options
cd /home/esp/workspace/wokwi/${{ matrix.project.name }}
/home/esp/.cargo/bin/cargo build --release ${{ matrix.project.arg }} --out-dir /home/esp/workspace/${{ matrix.project.path }}/${{ matrix.project.name }} -Z unstable-options
rm -rf /home/esp/workspace/${{ matrix.project.path }}/target
- name: Wokwi CI check
uses: wokwi/wokwi-ci-action@v1
Expand All @@ -70,4 +80,4 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.project.name }}_${{ matrix.project.id }}
path: ${{ matrix.project.name }}
path: ${{ matrix.project.path }}

0 comments on commit 6339c37

Please sign in to comment.