Issue279 replace with alias #384
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Format Code and Compile Test | |
on: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- ready_for_review | |
jobs: | |
# formatしてからbuild testしたいから一緒のgithub actionsにした | |
# format codes | |
format_code: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Format code | |
run: | | |
make format | |
- name: Check for changes | |
id: format-changes | |
run: | | |
if git diff --exit-code; then | |
echo "CHANGED=false" >> "$GITHUB_OUTPUT" | |
else | |
echo "CHANGED=true" >> "$GITHUB_OUTPUT" | |
fi | |
- name: Commit and push changes | |
if: steps.format-changes.outputs.CHANGED == 'true' | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: ":recycle:refactor: auto-format code" | |
# build test | |
build-macos: | |
if: github.event.pull_request.draft == false | |
name: Build on macOS | |
runs-on: macos-latest | |
needs: format_code | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run make (macOS) | |
run: make | |
build-ubuntu: | |
if: github.event.pull_request.draft == false | |
name: Build on Ubuntu | |
runs-on: ubuntu-latest | |
needs: format_code | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run make (Ubuntu) | |
run: make |