From e3df3ac5ce3d8ccb4c8b52eeaf0fef3ebd91eb14 Mon Sep 17 00:00:00 2001 From: hathach Date: Sun, 4 Dec 2022 20:29:24 +0700 Subject: [PATCH 1/4] add codespell config and ci run --- .codespell/exclude-file.txt | 1 + .codespellrc | 8 ++++++++ .github/workflows/build_arm.yml | 4 ++++ .github/workflows/pre-commit.yml | 24 ++++++++++++++++++++++++ 4 files changed, 37 insertions(+) create mode 100644 .codespell/exclude-file.txt create mode 100644 .codespellrc create mode 100644 .github/workflows/pre-commit.yml diff --git a/.codespell/exclude-file.txt b/.codespell/exclude-file.txt new file mode 100644 index 00000000..af8265cc --- /dev/null +++ b/.codespell/exclude-file.txt @@ -0,0 +1 @@ + return USB0.INTSTS1.BIT.ATTCH ? true : false; diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 00000000..0e1bc148 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,8 @@ +# See: https://github.com/codespell-project/codespell#using-a-config-file +[codespell] +# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here: +ignore-words-list = synopsys, sie, tre, hsi, fro, dout, mot, te +check-filenames = +check-hidden = +skip = .cproject,./.git,./hw/mcu,./lib,./examples/*/*/_build,./examples/*/*/ses,./examples/*/*/ozone,./hw/mcu,./test/vendor,./tests_obsolete +exclude-file = .codespell/exclude-file.txt diff --git a/.github/workflows/build_arm.yml b/.github/workflows/build_arm.yml index 369048fc..0dab46d0 100644 --- a/.github/workflows/build_arm.yml +++ b/.github/workflows/build_arm.yml @@ -7,6 +7,10 @@ on: types: - created +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: # --------------------------------------- # Unit testing with Ceedling diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 00000000..7baf66e7 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,24 @@ +name: pre-commit + +on: + pull_request: + push: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Checkout TinyUSB + uses: actions/checkout@v3 + + - name: Check Code Spelling + uses: codespell-project/actions-codespell@master \ No newline at end of file From b9314bddc5ca53c277a4472d7d162067c5e28604 Mon Sep 17 00:00:00 2001 From: hathach Date: Sun, 4 Dec 2022 20:52:02 +0700 Subject: [PATCH 2/4] check exclude file --- .codespell/exclude-file.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codespell/exclude-file.txt b/.codespell/exclude-file.txt index af8265cc..8b137891 100644 --- a/.codespell/exclude-file.txt +++ b/.codespell/exclude-file.txt @@ -1 +1 @@ - return USB0.INTSTS1.BIT.ATTCH ? true : false; + From b37870c964e9fafe8cdd4ff6e48fa072ca59858b Mon Sep 17 00:00:00 2001 From: hathach Date: Sun, 4 Dec 2022 21:08:47 +0700 Subject: [PATCH 3/4] test exclude-file.txt, add action concurrency --- .codespell/exclude-file.txt | 2 +- .codespellrc | 2 +- .github/workflows/build_aarch64.yml | 4 ++++ .github/workflows/build_arm.yml | 21 --------------------- .github/workflows/build_esp.yml | 4 ++++ .github/workflows/build_msp430.yml | 4 ++++ .github/workflows/build_renesas.yml | 4 ++++ .github/workflows/build_riscv.yml | 4 ++++ .github/workflows/pre-commit.yml | 16 ++++++++++++++-- 9 files changed, 36 insertions(+), 25 deletions(-) diff --git a/.codespell/exclude-file.txt b/.codespell/exclude-file.txt index 8b137891..af8265cc 100644 --- a/.codespell/exclude-file.txt +++ b/.codespell/exclude-file.txt @@ -1 +1 @@ - + return USB0.INTSTS1.BIT.ATTCH ? true : false; diff --git a/.codespellrc b/.codespellrc index 0e1bc148..19a877e2 100644 --- a/.codespellrc +++ b/.codespellrc @@ -5,4 +5,4 @@ ignore-words-list = synopsys, sie, tre, hsi, fro, dout, mot, te check-filenames = check-hidden = skip = .cproject,./.git,./hw/mcu,./lib,./examples/*/*/_build,./examples/*/*/ses,./examples/*/*/ozone,./hw/mcu,./test/vendor,./tests_obsolete -exclude-file = .codespell/exclude-file.txt +exclude-file = ./.codespell/exclude-file.txt diff --git a/.github/workflows/build_aarch64.yml b/.github/workflows/build_aarch64.yml index af26f33f..49973fe4 100644 --- a/.github/workflows/build_aarch64.yml +++ b/.github/workflows/build_aarch64.yml @@ -7,6 +7,10 @@ on: types: - created +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: # --------------------------------------- # Build AARCH64 family diff --git a/.github/workflows/build_arm.yml b/.github/workflows/build_arm.yml index 0dab46d0..56200465 100644 --- a/.github/workflows/build_arm.yml +++ b/.github/workflows/build_arm.yml @@ -12,27 +12,6 @@ concurrency: cancel-in-progress: true jobs: - # --------------------------------------- - # Unit testing with Ceedling - # --------------------------------------- - unit-test: - runs-on: ubuntu-latest - steps: - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '2.7' - - - name: Checkout TinyUSB - uses: actions/checkout@v3 - - - name: Unit Tests - run: | - # Install Ceedling - gem install ceedling - cd test - ceedling test:all - # --------------------------------------- # Build ARM family # --------------------------------------- diff --git a/.github/workflows/build_esp.yml b/.github/workflows/build_esp.yml index 51d91de4..d775e50b 100644 --- a/.github/workflows/build_esp.yml +++ b/.github/workflows/build_esp.yml @@ -7,6 +7,10 @@ on: types: - created +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: build-esp: runs-on: ubuntu-latest diff --git a/.github/workflows/build_msp430.yml b/.github/workflows/build_msp430.yml index 1ef25a6a..d28341e5 100644 --- a/.github/workflows/build_msp430.yml +++ b/.github/workflows/build_msp430.yml @@ -7,6 +7,10 @@ on: types: - created +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: build-msp430: runs-on: ubuntu-latest diff --git a/.github/workflows/build_renesas.yml b/.github/workflows/build_renesas.yml index 2e272c83..6cb873dd 100644 --- a/.github/workflows/build_renesas.yml +++ b/.github/workflows/build_renesas.yml @@ -7,6 +7,10 @@ on: types: - created +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: build-rx: runs-on: ubuntu-latest diff --git a/.github/workflows/build_riscv.yml b/.github/workflows/build_riscv.yml index 61c1c60c..18e952d9 100644 --- a/.github/workflows/build_riscv.yml +++ b/.github/workflows/build_riscv.yml @@ -7,6 +7,10 @@ on: types: - created +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: build-riscv: runs-on: ubuntu-latest diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 7baf66e7..2463903f 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -17,8 +17,20 @@ jobs: with: python-version: '3.x' + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '2.7' + - name: Checkout TinyUSB uses: actions/checkout@v3 - - name: Check Code Spelling - uses: codespell-project/actions-codespell@master \ No newline at end of file + - name: Run codespell + uses: codespell-project/actions-codespell@master + + - name: Run Unit Tests + run: | + # Install Ceedling + gem install ceedling + cd test + ceedling test:all \ No newline at end of file From feed1a83a9e7b63563278d4e86919077b4de2d72 Mon Sep 17 00:00:00 2001 From: hathach Date: Sun, 4 Dec 2022 21:28:20 +0700 Subject: [PATCH 4/4] add ignore-words to make it easier to --- .codespell/ignore-words.txt | 8 ++++++++ .codespellrc | 10 ++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 .codespell/ignore-words.txt diff --git a/.codespell/ignore-words.txt b/.codespell/ignore-words.txt new file mode 100644 index 00000000..e37d97a9 --- /dev/null +++ b/.codespell/ignore-words.txt @@ -0,0 +1,8 @@ +synopsys +sie +tre +hsi +fro +dout +mot +te diff --git a/.codespellrc b/.codespellrc index 19a877e2..142bbbe1 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,8 +1,10 @@ # See: https://github.com/codespell-project/codespell#using-a-config-file [codespell] -# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here: -ignore-words-list = synopsys, sie, tre, hsi, fro, dout, mot, te +# In the event of a false positive, add the problematic word, in all lowercase, to 'ignore-words.txt' (one word per line). +# Or copy & paste the whole problematic line to 'exclude-file.txt' +ignore-words = .codespell/ignore-words.txt +exclude-file = .codespell/exclude-file.txt check-filenames = check-hidden = -skip = .cproject,./.git,./hw/mcu,./lib,./examples/*/*/_build,./examples/*/*/ses,./examples/*/*/ozone,./hw/mcu,./test/vendor,./tests_obsolete -exclude-file = ./.codespell/exclude-file.txt +count = +skip = .cproject,./.git,./hw/mcu,./lib,./examples/*/*/_build,./examples/*/*/ses,./examples/*/*/ozone,./hw/mcu,./test/vendor,./tests_obsolete,./tools/uf2