Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Move pregen steps into a composite action #7474

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/actions/pregen/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: 'Setup and run pregeneration'
description: 'Sets up the dependencies needed to generate generated files and runs all generation scripts'

runs:
using: "composite"
steps:
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install jinja and protobuf
run: python -m pip install jinja2 protobuf grpcio-tools
shell: bash
- name: Install protobuf dependencies
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
wget https://github.com/HebiRobotics/QuickBuffers/releases/download/1.3.3/protoc-gen-quickbuf-1.3.3-linux-x86_64.exe
chmod +x protoc-gen-quickbuf-1.3.3-linux-x86_64.exe
shell: bash
- name: Regenerate hal
run: ./hal/generate_usage_reporting.py
shell: bash

- name: Regenerate ntcore
run: ./ntcore/generate_topics.py
shell: bash

- name: Regenerate imgui
run: |
./thirdparty/imgui_suite/generate_fonts.sh
./thirdparty/imgui_suite/generate_gl3w.py
shell: bash

- name: Regenerate HIDs
run: |
./wpilibc/generate_hids.py
./wpilibj/generate_hids.py
./wpilibNewCommands/generate_hids.py
shell: bash

- name: Regenerate PWM motor controllers
run: |
./wpilibc/generate_pwm_motor_controllers.py
./wpilibj/generate_pwm_motor_controllers.py
shell: bash

- name: Regenerate wpimath
run: |
./wpimath/generate_nanopb.py
./wpimath/generate_numbers.py
./wpimath/generate_quickbuf.py --quickbuf_plugin protoc-gen-quickbuf-1.3.3-linux-x86_64.exe
shell: bash

- name: Regenerate wpiunits
run: ./wpiunits/generate_units.py
shell: bash

- name: Regenerate wpiutil nanopb
run: ./wpiutil/generate_nanopb.py
shell: bash
12 changes: 2 additions & 10 deletions .github/workflows/comment-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,8 @@ jobs:
env:
GITHUB_TOKEN: "${{ secrets.COMMENT_COMMAND_PAT_TOKEN }}"
NUMBER: ${{ github.event.issue.number }}
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install jinja
run: python -m pip install jinja2
- name: Install protobuf dependencies
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler && wget https://github.com/HebiRobotics/QuickBuffers/releases/download/1.3.3/protoc-gen-quickbuf-1.3.3-linux-x86_64.exe && chmod +x protoc-gen-quickbuf-1.3.3-linux-x86_64.exe
- name: Regenerate all
run: ./.github/workflows/pregen_all.py --quickbuf_plugin=protoc-gen-quickbuf-1.3.3-linux-x86_64.exe
- name: Run pregen
uses: ./.github/actions/pregen
- name: Commit
run: |
# Set credentials
Expand Down
78 changes: 0 additions & 78 deletions .github/workflows/pregen_all.py

This file was deleted.

12 changes: 2 additions & 10 deletions .github/workflows/pregenerate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,8 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install jinja and protobuf
run: python -m pip install jinja2 protobuf grpcio-tools
- name: Install protobuf dependencies
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler && wget https://github.com/HebiRobotics/QuickBuffers/releases/download/1.3.3/protoc-gen-quickbuf-1.3.3-linux-x86_64.exe && chmod +x protoc-gen-quickbuf-1.3.3-linux-x86_64.exe
- name: Regenerate all
run: python ./.github/workflows/pregen_all.py --quickbuf_plugin protoc-gen-quickbuf-1.3.3-linux-x86_64.exe
- name: Run pregen
uses: ./.github/actions/pregen
- name: Add untracked files to index so they count as changes
run: git add -A
- name: Check output
Expand Down
Loading