mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-14 03:17:05 +00:00
c8afe3412e
Signed-off-by: Hector Martin <marcan@marcan.st>
43 lines
1.3 KiB
YAML
43 lines
1.3 KiB
YAML
# This is a basic workflow to help you get started with Actions
|
|
|
|
name: format-check
|
|
|
|
# Controls when the action will run.
|
|
on:
|
|
# Triggers the workflow on push or pull request events but only for the main branch
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
format-check:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: install nightly rust
|
|
run: |
|
|
rm -f ~/.cargo/bin/rustfmt
|
|
rm -f ~/.cargo/bin/cargo-fmt
|
|
rustup toolchain install nightly --component rustfmt --component clippy --allow-downgrade
|
|
|
|
- name: install clang-format-18
|
|
run: |
|
|
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
|
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main'
|
|
sudo apt update
|
|
sudo apt install clang-format-18
|
|
|
|
- name: Run format-check
|
|
run: |
|
|
make format CLANG_FORMAT=clang-format-18
|
|
git diff
|
|
git reset --hard
|
|
make format-check CLANG_FORMAT=clang-format-18
|
|
make rustfmt-check
|