Skip to content

Commit

Permalink
ci test
Browse files Browse the repository at this point in the history
Signed-off-by: Yu Chongbing <bd8ejk@foxmail.com>
  • Loading branch information
NanaHigh committed Oct 23, 2024
1 parent b32d35f commit 4a14d7a
Showing 1 changed file with 55 additions and 1 deletion.
56 changes: 55 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
branches: [ "main" ]
branches: [ "main", "nanahigh/test" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
Expand Down Expand Up @@ -127,6 +127,60 @@ jobs:
run: |
cargo build --target ${{ matrix.TARGET }} --verbose -p sbi-testing --features "log"
check-changlog:
name: Check if `CHANGELOG.md` is updated
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get the latest commit's hash
run: |
latest_commit_hash=$(git log -1 --format='%H')
- name: Get update files
run: |
updated_files=$(git diff -r --name-only -c "$latest_commit_hash" main)
- name: Check if changlog is updated
run: |
for file_path in $updated_files; do
# Get latest updated files' paths
updated_paths=$(dirname "$file_path")
changelog_path="$directory/CHANGELOG.md"
if [[ -f "$changelog_path" ]]; then
# Find changelog
echo "File $changelog_path exists."
# Check if changelog is updated
if git diff --name-only "$directory" | grep -q "CHANGELOG.md"; then
echo "File $changelog_path changed in the latest commit $latest_commit_hash."
else
echo "File $changelog_path is not changed in the latest commit $latest_commit_hash."
exit 1
fi
else
echo "File $changelog_path does not exist."
fi
done
check-commit-signatures:
name: Check commit signatures
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check if commit is signed
run: |
COMMIT=$(git log -1)
if echo "$COMMIT" | grep -q "Author: "; then
echo "Commit is signed."
else
echo "Commit is NOT signed."
exit 1
fi
- name: Print author's information
run: |
AUTHOR_NAME=$(git log -1 --format='%an')
AUTHOR_EMAIL=$(git log -1 --format='%ae')
echo "Author's name: $AUTHOR_NAME"
echo "Author's email: $AUTHOR_EMAIL"
# sbi-testing:
# name: Run rust-clippy analyzing
# runs-on: ubuntu-latest
Expand Down

0 comments on commit 4a14d7a

Please sign in to comment.