diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6073595..ad26b7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,6 @@ name: CI on: push: - branches: pull_request: schedule: - cron: '50 7 * * *' @@ -24,13 +23,21 @@ jobs: run: rustup component add rust-src --toolchain ${{ env.rust_toolchain }}-x86_64-unknown-linux-gnu - name: Setup | Default to nightly run: rustup default ${{ env.rust_toolchain }} - - name: Setup | cargo-generate + - name: Setup | cargo-generate (binaries) + id: binaries + continue-on-error: true + run: | + sudo curl -L "https://github.com/cargo-generate/cargo-generate/releases/latest/download/cargo-generate-$(git ls-remote --refs --sort="version:refname" --tags "https://github.com/cargo-generate/cargo-generate" | cut -d/ -f3- | tail -n1)-x86_64-unknown-linux-gnu.tar.gz" -o "/home/runner/.cargo/bin/cargo-generate.tar.gz" + tar xf "/home/runner/.cargo/bin/cargo-generate.tar.gz" -C /home/runner/.cargo/bin + chmod u+x /home/runner/.cargo/bin/cargo-generate + - name: Setup | cargo-generate (cargo) + if: steps.binaries.outcome != 'success' run: cargo install cargo-generate - name: Setup | ldproxy run: cargo install ldproxy # - name: (STD, PIO, V4.3.2) Generate (PR) # if: ${{ github.event_name == 'pull_request' }} - # run: cargo generate --git https://github.com/${{ github.repository }} --branch ${{ github.head_ref }} cargo --name test --vcs none --silent -d mcu=esp32c3 -d std=true -d espidfver=v4.3.2 -d devcontainer=false + # run: cargo generate --git https://github.com/${{ github.event.pull_request.head.repo.full_name }} --branch ${{ github.head_ref }} cargo --name test --vcs none --silent -d mcu=esp32c3 -d std=true -d espidfver=v4.3.2 -d devcontainer=false # - name: (STD, PIO, V4.3.2) Generate # if: ${{ github.event_name != 'pull_request' }} # run: cargo generate --git https://github.com/esp-rs/esp-idf-template --branch ${{ github.ref_name }} cargo --name test --vcs none --silent -d mcu=esp32c3 -d std=true -d espidfver=v4.3.2 -d devcontainer=false @@ -42,7 +49,7 @@ jobs: # run: cd test; cargo build --features pio - name: (NOSTD, NATIVE, V4.4) Generate (PR) if: ${{ github.event_name == 'pull_request' }} - run: cargo generate --git https://github.com/${{ github.repository }} --branch ${{ github.head_ref }} cargo --name testnostd --vcs none --silent -d mcu=esp32c3 -d std=false -d espidfver=v4.4 -d devcontainer=false + run: cargo generate --git https://github.com/${{ github.event.pull_request.head.repo.full_name }} --branch ${{ github.head_ref }} cargo --name testnostd --vcs none --silent -d mcu=esp32c3 -d std=false -d espidfver=v4.4 -d devcontainer=false - name: (NOSTD, NATIVE, V4.4) Generate if: ${{ github.event_name != 'pull_request' }} run: cargo generate --git https://github.com/esp-rs/esp-idf-template --branch ${{ github.ref_name }} cargo --name testnostd --vcs none --silent -d mcu=esp32c3 -d std=false -d espidfver=v4.4 -d devcontainer=false @@ -54,7 +61,7 @@ jobs: run: cd testnostd; cargo build - name: (STD, CMake, V4.4) Generate (PR) if: ${{ github.event_name == 'pull_request' }} - run: cargo generate --git https://github.com/${{ github.repository }} --branch ${{ github.head_ref }} cmake --name testidf --vcs none --silent -d toolchain=nightly -d std=true -d espidfver=v4.4 + run: cargo generate --git https://github.com/${{ github.event.pull_request.head.repo.full_name }} --branch ${{ github.head_ref }} cmake --name testidf --vcs none --silent -d toolchain=nightly -d std=true -d espidfver=v4.4 - name: (STD, CMake, V4.4) Generate if: ${{ github.event_name != 'pull_request' }} run: cargo generate --git https://github.com/esp-rs/esp-idf-template --branch ${{ github.ref_name }} cmake --name testidf --vcs none --silent -d toolchain=nightly -d std=true -d espidfver=v4.4 @@ -75,20 +82,25 @@ jobs: board: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3'] std: ['true', 'false'] steps: - - name: Install cargo-generate + - name: Install cargo-generate via binaries + id: binaries + continue-on-error: true run: | - sudo curl -L "https://github.com/cargo-generate/cargo-generate/releases/latest/download/cargo-generate-v0.15.2-x86_64-unknown-linux-gnu.tar.gz" -o "/home/runner/.cargo/bin/cargo-generate.tar.gz" + sudo curl -L "https://github.com/cargo-generate/cargo-generate/releases/latest/download/cargo-generate-$(git ls-remote --refs --sort="version:refname" --tags "https://github.com/cargo-generate/cargo-generate" | cut -d/ -f3- | tail -n1)-x86_64-unknown-linux-gnu.tar.gz" -o "/home/runner/.cargo/bin/cargo-generate.tar.gz" tar xf "/home/runner/.cargo/bin/cargo-generate.tar.gz" -C /home/runner/.cargo/bin chmod u+x /home/runner/.cargo/bin/cargo-generate + - name: Install cargo-generate via cargo + if: steps.binaries.outcome != 'success' + run: cargo install cargo-generate - name: Generate Project - Xtensa Targets (PR) if: (matrix.board == 'esp32' || matrix.board == 'esp32s2' || matrix.board == 'esp32s3') && github.event_name == 'pull_request' - run: cargo generate --git https://github.com/${{ github.repository }} --branch ${{ github.head_ref }} cargo --name test-${{ matrix.board }} --vcs none --silent -d mcu=${{ matrix.board }} -d toolchain=esp -d std=${{ matrix.std }} -d espidfver=v4.4 -d devcontainer=true + run: cargo generate --git https://github.com/${{ github.event.pull_request.head.repo.full_name }} --branch ${{ github.head_ref }} cargo --name test-${{ matrix.board }} --vcs none --silent -d mcu=${{ matrix.board }} -d toolchain=esp -d std=${{ matrix.std }} -d espidfver=v4.4 -d devcontainer=true - name: Generate Project - Xtensa Targets if: (matrix.board == 'esp32' || matrix.board == 'esp32s2' || matrix.board == 'esp32s3') && github.event_name != 'pull_request' run: cargo generate --git https://github.com/esp-rs/esp-idf-template --branch ${{ github.ref_name }} cargo --name test-${{ matrix.board }} --vcs none --silent -d mcu=${{ matrix.board }} -d toolchain=esp -d std=${{ matrix.std }} -d espidfver=v4.4 -d devcontainer=true - name: Generate Project - RiscV Targets (PR) if: matrix.board == 'esp32c3' && github.event_name == 'pull_request' - run: cargo generate --git https://github.com/${{ github.repository }} --branch ${{ github.head_ref }} cargo --name test-${{ matrix.board }} --vcs none --silent -d mcu=${{ matrix.board }} -d toolchain=nightly -d std=${{ matrix.std }} -d espidfver=v4.4 -d devcontainer=true + run: cargo generate --git https://github.com/${{ github.event.pull_request.head.repo.full_name }} --branch ${{ github.head_ref }} cargo --name test-${{ matrix.board }} --vcs none --silent -d mcu=${{ matrix.board }} -d toolchain=nightly -d std=${{ matrix.std }} -d espidfver=v4.4 -d devcontainer=true - name: Generate Project - RiscV Targets if: matrix.board == 'esp32c3' && github.event_name != 'pull_request' run: cargo generate --git https://github.com/esp-rs/esp-idf-template --branch ${{ github.ref_name }} cargo --name test-${{ matrix.board }} --vcs none --silent -d mcu=${{ matrix.board }} -d toolchain=nightly -d std=${{ matrix.std }} -d espidfver=v4.4 -d devcontainer=true