Skip to content
Open
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
34 changes: 24 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,33 @@ on:
branches: [ main ]

jobs:
check:
test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: default
features: ''
- name: debounce-polling
features: '--features debounce,polling'
- name: debounce-interrupt
features: '--features debounce,interrupt'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
targets: thumbv7em-none-eabihf
- name: Cargo check (core)
run: cargo check -p keyboard-core
- name: Cargo check (firmware)
run: cargo check -p firmware --target thumbv7em-none-eabihf
- name: Cargo check (simulator)
run: cargo check -p simulator
- name: Cargo check (bootloader)
run: cargo check -p bootloader --target thumbv7em-none-eabihf
- name: Install Tarpaulin
run: cargo install cargo-tarpaulin
- name: Cargo fmt
run: cargo fmt --all --check
- name: Cargo clippy
run: cargo clippy ${{ matrix.features }} -- -D warnings
- name: Cargo test
run: cargo test ${{ matrix.features }}
- name: Coverage
run: cargo tarpaulin ${{ matrix.features }} --out Xml
- name: Upload coverage
uses: codecov/codecov-action@v4
with:
files: ./tarpaulin-report.xml
19 changes: 19 additions & 0 deletions .github/workflows/firmware.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Firmware Build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
targets: thumbv7em-none-eabihf
- name: Build firmware
run: cargo build -p firmware --release --target=thumbv7em-none-eabihf
Comment on lines +11 to +19

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 6 months ago

To fix the issue, add a permissions block at the root of the workflow file. This block will explicitly define the minimal permissions required for the workflow. Since the workflow only checks out the repository and builds the firmware, it likely only needs contents: read permission. This ensures that the GITHUB_TOKEN has the least privilege necessary to perform the workflow tasks.

The permissions block should be added immediately after the name field in the workflow file to apply to all jobs in the workflow.


Suggested changeset 1
.github/workflows/firmware.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/firmware.yml b/.github/workflows/firmware.yml
--- a/.github/workflows/firmware.yml
+++ b/.github/workflows/firmware.yml
@@ -1,2 +1,4 @@
 name: Firmware Build
+permissions:
+  contents: read
 
EOF
@@ -1,2 +1,4 @@
name: Firmware Build
permissions:
contents: read

Copilot is powered by AI and may make mistakes. Always verify output.
Loading