diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9cc11c6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: + pull_request: + branches: + - main + push: + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +# 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: + all: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@v1 + with: + target: riscv32imc-unknown-none-elf + toolchain: nightly-2023-03-09 + components: rust-src,rustfmt + - uses: esp-rs/xtensa-toolchain@v1.5 + with: + ldproxy: false + override: false + - uses: Swatinem/rust-cache@v2 + - uses: extractions/setup-just@v1 + with: + just-version: 1.13.0 + + - name: check + run: just diff --git a/justfile b/justfile new file mode 100644 index 0000000..3b4dea3 --- /dev/null +++ b/justfile @@ -0,0 +1,13 @@ +export SSID := "Dummy" +export PASSWORD := "Dummy" + +all: (check "esp32" "esp") (check "esp32s3" "esp") (check "esp32c3" "nightly-2023-03-09") + cd esp-mbedtls && cargo +nightly-2023-03-09 fmt --all -- --check + +[private] +check target toolchain: + cd examples-{{ target }} && cargo +{{ toolchain }} check --example sync + cd examples-{{ target }} && cargo +{{ toolchain }} check --example sync_client + cd examples-{{ target }} && cargo +{{ toolchain }} check --example async --features=async + cd examples-{{ target }} && cargo +{{ toolchain }} check --example async_client --features=async + cd examples-{{ target }} && cargo +{{ toolchain }} fmt --all -- --check