Skip to content

Commit

Permalink
style(gh-workflows): fix YAML indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ROMemories committed Mar 5, 2024
1 parent fc7cebf commit 2eb57ad
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 146 deletions.
64 changes: 32 additions & 32 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,35 @@ jobs:
if: github.repository == 'future-proof-iot/RIOT-rs'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install mdbook
run: |
mkdir mdbook
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.36/mdbook-v0.4.36-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Build docs
run: |
cd book
mdbook build
- name: Update gh-pages branch
# This has no reason to fail, only the commit step fails if there are no
# changes.
continue-on-error: true
run: |
cd book
git worktree add gh-pages gh-pages
git config user.name "Deploy from CI"
git config user.email ""
cd gh-pages
git rm -rf dev
mv ../book dev
git add dev
git commit -m "Deploy $GITHUB_SHA to gh-pages"
- name: Deploy changed book
# only deploy if there were changes
if: success()
run: |
cd book/gh-pages
git push --force
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install mdbook
run: |
mkdir mdbook
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.36/mdbook-v0.4.36-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Build docs
run: |
cd book
mdbook build
- name: Update gh-pages branch
# This has no reason to fail, only the commit step fails if there are no
# changes.
continue-on-error: true
run: |
cd book
git worktree add gh-pages gh-pages
git config user.name "Deploy from CI"
git config user.email ""
cd gh-pages
git rm -rf dev
mv ../book dev
git add dev
git commit -m "Deploy $GITHUB_SHA to gh-pages"
- name: Deploy changed book
# only deploy if there were changes
if: success()
run: |
cd book/gh-pages
git push --force
6 changes: 3 additions & 3 deletions .github/workflows/git.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Block Fixup Commit Merge
uses: 13rac1/block-fixup-merge-action@v2.0.0
- uses: actions/checkout@v4
- name: Block Fixup Commit Merge
uses: 13rac1/block-fixup-merge-action@v2.0.0
180 changes: 90 additions & 90 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: CI
on:
push:
branches:
- main
- main
pull_request:
branches:
- main
- main
merge_group:

jobs:
Expand All @@ -23,105 +23,105 @@ jobs:
partition: [ "1/10", "2/10", "3/10", "4/10", "5/10", "6/10", "7/10", "8/10", "9/10", "10/10" ]

steps:
- name: Check out repository code
uses: actions/checkout@v4

- name: Get git tree hash
id: get-tree-hash
run: |
git rev-parse HEAD^{tree} > .tree-hash
echo "hash=$(cat .tree-hash)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: result-cache
with:
path: .tree-hash
key: success-${{ steps.get-tree-hash.outputs.hash }}-${{ matrix.partition }}

- name: Run sccache-cache
if: steps.result-cache.outputs.cache-hit != 'true'
uses: mozilla-actions/sccache-action@v0.0.4

- name: Install toolchain
if: steps.result-cache.outputs.cache-hit != 'true'
uses: dtolnay/rust-toolchain@nightly
with:
targets: thumbv6m-none-eabi,thumbv7m-none-eabi,thumbv7em-none-eabi

- name: rust cache
if: steps.result-cache.outputs.cache-hit != 'true'
uses: Swatinem/rust-cache@v2
with:
key: "${{ matrix.partition }}"

- uses: taiki-e/install-action@v2
if: steps.result-cache.outputs.cache-hit != 'true'
with:
tool: cargo-binstall

- name: "installing prerequisites"
if: steps.result-cache.outputs.cache-hit != 'true'
run: |
git config --global init.defaultBranch main
git config --global user.email "ci@riot-labs.de"
git config --global user.name "CI"
cargo binstall --no-confirm --no-symlinks --force --no-discover-github-token laze
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
sudo apt-get install ninja-build
- name: "riot-rs compilation test"
if: steps.result-cache.outputs.cache-hit != 'true'
run: |
sccache --start-server || true # work around https://github.com/ninja-build/ninja/issues/2052
laze build --partition hash:${{ matrix.partition }} --builders microbit-v2,nrf52840dk,rpi-pico,rpi-pico-w -g
- name: Check out repository code
uses: actions/checkout@v4

- name: Get git tree hash
id: get-tree-hash
run: |
git rev-parse HEAD^{tree} > .tree-hash
echo "hash=$(cat .tree-hash)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: result-cache
with:
path: .tree-hash
key: success-${{ steps.get-tree-hash.outputs.hash }}-${{ matrix.partition }}

- name: Run sccache-cache
if: steps.result-cache.outputs.cache-hit != 'true'
uses: mozilla-actions/sccache-action@v0.0.4

- name: Install toolchain
if: steps.result-cache.outputs.cache-hit != 'true'
uses: dtolnay/rust-toolchain@nightly
with:
targets: thumbv6m-none-eabi,thumbv7m-none-eabi,thumbv7em-none-eabi

- name: rust cache
if: steps.result-cache.outputs.cache-hit != 'true'
uses: Swatinem/rust-cache@v2
with:
key: "${{ matrix.partition }}"

- uses: taiki-e/install-action@v2
if: steps.result-cache.outputs.cache-hit != 'true'
with:
tool: cargo-binstall

- name: "installing prerequisites"
if: steps.result-cache.outputs.cache-hit != 'true'
run: |
git config --global init.defaultBranch main
git config --global user.email "ci@riot-labs.de"
git config --global user.name "CI"
cargo binstall --no-confirm --no-symlinks --force --no-discover-github-token laze
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
sudo apt-get install ninja-build
- name: "riot-rs compilation test"
if: steps.result-cache.outputs.cache-hit != 'true'
run: |
sccache --start-server || true # work around https://github.com/ninja-build/ninja/issues/2052
laze build --partition hash:${{ matrix.partition }} --builders microbit-v2,nrf52840dk,rpi-pico,rpi-pico-w -g
lint:
runs-on: ubuntu-latest

steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Check out repository code
uses: actions/checkout@v4

- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: clippy, rustfmt
- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: clippy, rustfmt

- name: rust cache
uses: Swatinem/rust-cache@v2
- name: rust cache
uses: Swatinem/rust-cache@v2

# TODO: we'll eventually want to check the whole workspace with --workspace
# TODO: we'll eventually want to check relevant feature combinations
# TODO: we may want to use --no-deps as well
- name: clippy
uses: clechasseur/rs-clippy-check@v3
with:
args: --verbose --locked -p riot-rs-embassy
# TODO: we'll eventually want to check the whole workspace with --workspace
# TODO: we'll eventually want to check relevant feature combinations
# TODO: we may want to use --no-deps as well
- name: clippy
uses: clechasseur/rs-clippy-check@v3
with:
args: --verbose --locked -p riot-rs-embassy

# TODO: we'll eventually want to enable relevant features
- name: "rustdoc"
run: cargo rustdoc -p riot-rs --features no-boards -- -D warnings
# TODO: we'll eventually want to enable relevant features
- name: "rustdoc"
run: cargo rustdoc -p riot-rs --features no-boards -- -D warnings

- name: rustfmt
run: cargo fmt --check --all
- name: rustfmt
run: cargo fmt --check --all

- name: Install rust-sort
run: cargo install --git=https://github.com/DevinR528/cargo-sort --rev 55ec89082466f6bb246d870a8d56d166a8e1f08b cargo-sort
- name: Install rust-sort
run: cargo install --git=https://github.com/DevinR528/cargo-sort --rev 55ec89082466f6bb246d870a8d56d166a8e1f08b cargo-sort

- name: Check formatting and item order of Cargo.toml files
run: cargo sort --check --check-format --grouped --workspace
- name: Check formatting and item order of Cargo.toml files
run: cargo sort --check --check-format --grouped --workspace

CI-success:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Final Results
needs: [build]
steps:
- run: |
result="${{ needs.build.result }}"
if [[ $result == "success" || $result == "skipped" ]]; then
exit 0
else
exit 1
fi
if: ${{ always() }}
runs-on: ubuntu-latest
name: Final Results
needs: [build]
steps:
- run: |
result="${{ needs.build.result }}"
if [[ $result == "success" || $result == "skipped" ]]; then
exit 0
else
exit 1
fi
42 changes: 21 additions & 21 deletions .github/workflows/matrix-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,36 @@ jobs:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: send message
uses: s3krit/matrix-message-action@v0.0.3
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "New PR: [${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})"
server: "matrix.org"
- name: send message
uses: s3krit/matrix-message-action@v0.0.3
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "New PR: [${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})"
server: "matrix.org"

merged-pr:
if: github.event.action == 'closed' && github.event.pull_request.merged == true && github.repository == 'future-proof-iot/RIOT-rs'
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: send message
uses: s3krit/matrix-message-action@v0.0.3
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "PR merged: [${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})"
server: "matrix.org"
- name: send message
uses: s3krit/matrix-message-action@v0.0.3
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "PR merged: [${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})"
server: "matrix.org"

abandoned-pr:
if: github.event.action == 'closed' && github.event.pull_request.merged == false && github.repository == 'future-proof-iot/RIOT-rs'
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: send message
uses: s3krit/matrix-message-action@v0.0.3
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "PR closed without merging: [${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})"
server: "matrix.org"
- name: send message
uses: s3krit/matrix-message-action@v0.0.3
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "PR closed without merging: [${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})"
server: "matrix.org"

0 comments on commit 2eb57ad

Please sign in to comment.