Skip to content
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

Unify hal_(doc|build)_variants properties #677

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion .github/actions/list-HAL-variants/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ runs:
- id: compute-matrix
shell: bash
run: |
matrix_json=$(cat crates.json | jq -Mr -c '{ "pac": (.hal_build_variants | keys ), "toolchain": ["stable", "nightly"] }')
matrix_json=$(cat crates.json | jq -Mr -c '{ "pac": (.hal_variants | keys ), "toolchain": ["stable", "nightly"] }')
echo "matrix=${matrix_json}" >> $GITHUB_OUTPUT
6 changes: 3 additions & 3 deletions .github/workflows/build-hal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: |
rustup set profile minimal
rustup override set ${{ matrix.toolchain }}
target=$(cat ./crates.json | jq -Mr --arg pac "${{matrix.pac}}" -c '.hal_build_variants["${{matrix.pac}}"].target')
target=$(cat ./crates.json | jq -Mr --arg pac "${{matrix.pac}}" -c '.hal_variants["${{matrix.pac}}"].target')
rustup target add ${target}
rustup component add clippy

Expand All @@ -36,6 +36,6 @@ jobs:
- name: Build HAL for ${{ matrix.pac }}
run: |
set -ex
features=$(cat ./crates.json | jq -Mr --arg pac "${{matrix.pac}}" -c '.hal_build_variants["${{matrix.pac}}"].features | join(",")')
target=$(cat ./crates.json | jq -Mr --arg pac "${{matrix.pac}}" -c '.hal_build_variants["${{matrix.pac}}"].target')
features=$(cat ./crates.json | jq -Mr --arg pac "${{matrix.pac}}" -c '.hal_variants["${{matrix.pac}}"].features | join(",")')
target=$(cat ./crates.json | jq -Mr --arg pac "${{matrix.pac}}" -c '.hal_variants["${{matrix.pac}}"].target')
cargo clippy --features=${features} --target=${target} --manifest-path=./hal/Cargo.toml -- -D warnings
12 changes: 6 additions & 6 deletions .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:
mkdir -pv "${docs_path}"
(cd "$docs_path" && git init && git checkout -b main)

for variant in $(cat crates.json | jq -Mr -c '.hal_doc_variants | keys[]');
for variant in $(cat crates.json | jq -Mr -c '.hal_variants | keys[]');
do
(
feature_str=$(cat crates.json | jq -Mr --arg variant "${variant}" -c '.hal_doc_variants[$variant].features | join(",")')
target=$(cat crates.json | jq -Mr --arg variant "${variant}" -c '.hal_doc_variants[$variant].target')
feature_str=$(cat crates.json | jq -Mr --arg variant "${variant}" -c '.hal_variants[$variant].features | join(",")')
target=$(cat crates.json | jq -Mr --arg variant "${variant}" -c '.hal_variants[$variant].target')

mkdir -pv "${docs_path}/${variant}"
cd hal
Expand Down Expand Up @@ -69,10 +69,10 @@ jobs:
echo ' </thead>' >> "${docs_path}/index.html"

echo ' <tbody>' >> "${docs_path}/index.html"
for variant in $(cat crates.json | jq -Mr -c '.hal_doc_variants | keys[]');
for variant in $(cat crates.json | jq -Mr -c '.hal_variants | keys[]');
do
target=$(cat crates.json | jq -Mr --arg variant "${variant}" -c '.hal_doc_variants[$variant].target')
features_html=$(cat crates.json | jq -Mr --arg variant "${variant}" -c '.hal_doc_variants[$variant].features | map("<span class=\"label label-default\">", . , "</span>") | join(" ")')
target=$(cat crates.json | jq -Mr --arg variant "${variant}" -c '.hal_variants[$variant].target')
features_html=$(cat crates.json | jq -Mr --arg variant "${variant}" -c '.hal_variants[$variant].features | map("<span class=\"label label-default\">", . , "</span>") | join(" ")')

echo ' <tr>' >> "${docs_path}/index.html"
echo " <td><a href='${variant}/${target}/doc/atsamd_hal/index.html'>${variant}</a></td>" >> "${docs_path}/index.html"
Expand Down
92 changes: 8 additions & 84 deletions crates.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,112 +171,36 @@
"target": "thumbv6m-none-eabi"
}
},
"hal_doc_variants": {
"hal_variants": {
"samd11c": {
"features": [
"samd11c",
"dma",
"defmt"
],
"target": "thumbv6m-none-eabi"
},
"samd11d": {
"features": [
"samd11d",
"dma",
"defmt"
],
"target": "thumbv6m-none-eabi"
},
"samd21g": {
"features": [
"samd21g",
"usb",
"dma",
"defmt"
],
"target": "thumbv6m-none-eabi"
},
"samd21j": {
"features": [
"samd21j",
"usb",
"dma",
"defmt"
],
"target": "thumbv6m-none-eabi"
},
"samd51g": {
"features": [
"samd51g",
"usb",
"sdmmc",
"dma",
"defmt"
],
"target": "thumbv7em-none-eabihf"
},
"samd51j": {
"features": [
"samd51j",
"usb",
"sdmmc",
"dma",
"defmt"
],
"target": "thumbv7em-none-eabihf"
},
"samd51n": {
"features": [
"samd51n",
"usb",
"sdmmc",
"dma",
"defmt"
],
"target": "thumbv7em-none-eabihf"
},
"samd51p": {
"features": [
"samd51p",
"usb",
"sdmmc",
"dma",
"defmt"
],
"target": "thumbv7em-none-eabihf"
}
},
"hal_build_variants": {
"samd11c": {
"features": [ "samd11c", "dma", "rtic", "defmt" ],
"target": "thumbv6m-none-eabi"
},
"samd11d": {
"samd11d": {
"features": [ "samd11d", "dma", "rtic", "defmt" ],
"target": "thumbv6m-none-eabi"
},
"samd21e": {
"samd21e": {
"features": [ "samd21e", "usb", "dma", "rtic", "defmt" ],
"target": "thumbv6m-none-eabi"
},
"samd21el": {
"samd21el": {
"features": [ "samd21el", "dma", "rtic", "defmt" ],
"target": "thumbv6m-none-eabi"
},
"samd21g": {
"samd21g": {
"features": [ "samd21g", "usb", "dma", "rtic", "defmt" ],
"target": "thumbv6m-none-eabi"
},
"samd21gl": {
"samd21gl": {
"features": [ "samd21gl", "dma", "rtic", "defmt" ],
"target": "thumbv6m-none-eabi"
},
"samd21j": {
"samd21j": {
"features": [ "samd21j", "usb", "dma", "rtic", "defmt" ],
"target": "thumbv6m-none-eabi"
},
"samd51g": {
"samd51g": {
"features": [ "samd51g", "usb", "dma", "sdmmc", "rtic", "defmt" ],
"target": "thumbv7em-none-eabihf"
},
Expand Down