Skip to content

Commit

Permalink
ci: Move codegen job to tidy reusable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Feb 1, 2025
1 parent 31c691d commit 96e1aba
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,13 @@ jobs:
miri:
uses: taiki-e/github-actions/.github/workflows/miri.yml@main
with:
event_name: ${{ github.event_name }}
# We don't support x86_64, so use aarch64-unknown-linux-gnu instead.
target: aarch64-unknown-linux-gnu
# NB: sync with env.TEST_FEATURES
args: --features alloc,stdio,fs,args,time
msrv:
uses: taiki-e/github-actions/.github/workflows/msrv.yml@main
with:
event_name: ${{ github.event_name }}
# We don't support x86_64, so use aarch64-unknown-linux-gnu instead.
target: aarch64-unknown-linux-gnu
# NB: sync with env.TEST_FEATURES
Expand Down Expand Up @@ -200,35 +198,3 @@ jobs:
if: startsWith(matrix.os, 'ubuntu') || matrix.os == ''
- run: cargo +esp build --target xtensa-esp32-none-elf -Z build-std=core,alloc --features "${TEST_FEATURES},openocd-semihosting"
if: matrix.rust == 'stable' && (startsWith(matrix.os, 'ubuntu') || matrix.os == '')

codegen:
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: read
pull-requests: write # for gh pr edit --add-assignee
repository-projects: read # for gh pr edit --add-assignee
steps:
- uses: taiki-e/checkout-action@v1
- uses: taiki-e/github-actions/install-rust@nightly
- run: tools/gen.sh
- name: Handle diff
id: diff
run: tools/ci/gen.sh
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main')
- run: git add -N . && git diff --exit-code
- id: create-pull-request
uses: peter-evans/create-pull-request@v7
with:
title: Update generated code
body: |
Auto-generated by CI using [create-pull-request](https://github.com/peter-evans/create-pull-request).
branch: update-generated-code
token: ${{ secrets.CREATE_PR_TOKEN }}
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false'
- name: Notify PR author by assigning PR
run: gh pr edit --add-assignee taiki-e "${PR_NUMBER:?}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ steps.create-pull-request.outputs.pull-request-number }}
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false'

0 comments on commit 96e1aba

Please # to comment.