Skip to content

Add CI #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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
13 changes: 13 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -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