Add options to list and get a detailed explanation of options #1349
This file contains hidden or 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
| name: CI | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| paths-ignore: | |
| - "**/README.md" | |
| merge_group: | |
| schedule: | |
| - cron: "34 2 * * *" | |
| workflow_dispatch: | |
| inputs: | |
| build: | |
| description: "Fully build the tested configurations" | |
| required: true | |
| type: boolean | |
| all_combinations: | |
| description: "Checks all combinations of options" | |
| required: true | |
| type: boolean | |
| env: | |
| CARGO_TARGET_DIR: ${{ github.workspace }}/target | |
| CARGO_TERM_COLOR: always | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| MSRV: "1.86" | |
| SSID: "" | |
| PASSWORD: "" | |
| # Cancel any currently running workflows from the same PR, branch, or | |
| # tag when a new workflow is triggered. | |
| # | |
| # https://stackoverflow.com/a/66336834 | |
| concurrency: | |
| cancel-in-progress: true | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| jobs: | |
| # -------------------------------------------------------------------------- | |
| # Verify | |
| verify: | |
| name: "Check ${{ matrix.chip }}" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| chip: [esp32, esp32c2, esp32c3, esp32c6, esp32h2, esp32s2, esp32s3] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| # Rust toolchain for Xtensa: | |
| - if: ${{ contains(fromJson('["esp32", "esp32s2", "esp32s3"]'), matrix.chip) }} | |
| uses: esp-rs/[email protected] | |
| with: | |
| default: true | |
| buildtargets: ${{ matrix.chip }} | |
| ldproxy: false | |
| # Rust toolchain for RISC-V: | |
| - if: ${{ !contains(fromJson('["esp32", "esp32s2", "esp32s3"]'), matrix.chip) }} | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf | |
| components: clippy,rustfmt,rust-src | |
| # Rust toolchain for RISC-V: | |
| - if: ${{ !contains(fromJson('["esp32", "esp32s2", "esp32s3"]'), matrix.chip) }} | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf | |
| components: clippy,rustfmt,rust-src | |
| # //Define a new environment variable called toolchain | |
| - if: ${{ contains(fromJson('["esp32", "esp32s2", "esp32s3"]'), matrix.chip) }} | |
| run: echo "TOOLCHAIN=+esp" >> $GITHUB_ENV | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Generate and check project | |
| run: cargo ${{ env.TOOLCHAIN }} xtask check ${{ matrix.chip }} ${{ fromJSON('["", "--all-combinations"]')[inputs.all_combinations || github.event_name == 'schedule'] }} ${{ fromJSON('["", "--build"]')[inputs.build || github.event_name == 'schedule'] }} | |
| - if: github.event_name == 'schedule' | |
| name: Run cargo-package | |
| run: cargo package --allow-dirty | |
| - if: ${{ github.event_name == 'schedule' && failure() }} | |
| name: Create or Update GitHub Issue | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| sudo apt-get install gh -y | |
| ISSUE_NAME=$(gh issue list --state open --search "Scheduled CI Failure in:title" --json number --jq '.[0].number') | |
| if [[ -z "$ISSUE_NAME" ]]; | |
| then | |
| gh issue create \ | |
| --title "Scheduled CI Failure" \ | |
| --body "Scheduled CI Workflow Failed! [View the failed job](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})." | |
| fi | |
| # -------------------------------------------------------------------------- | |
| # Test | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Run tests | |
| run: cargo test | |
| # -------------------------------------------------------------------------- | |
| # Lint | |
| clippy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - name: Run clippy | |
| run: cargo clippy -- -D warnings | |
| # -------------------------------------------------------------------------- | |
| # MSRV | |
| msrv: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@v1 | |
| with: | |
| toolchain: ${{ env.MSRV }} | |
| - run: cargo check -p esp-generate |