-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Antonio Gisondi <[email protected]>
- Loading branch information
Showing
2 changed files
with
35 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,7 +72,21 @@ jobs: | |
- name: Generate Python code | ||
run: python3 ./protoc.py "./../grpc/grpc_python_plugin" | ||
working-directory: ./python | ||
|
||
- name: Upload Python code | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: python | ||
path: ./python | ||
|
||
rust-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install protoc | ||
run: | | ||
curl -LO $PB_REL/download/v24.3/protoc-24.3-linux-x86_64.zip | ||
unzip protoc-24.3-linux-x86_64.zip -d $HOME/.local | ||
echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
- name: Install rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
|
@@ -85,13 +99,27 @@ jobs: | |
- name: Generate Rust code with cargo build | ||
run: cargo build | ||
working-directory: ./rust | ||
- name: Commit the generated code | ||
if: github.event_name == 'push' | ||
run: | | ||
- name: Upload Rust code | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: rust | ||
path: ./rust | ||
|
||
commit_and_push_code: | ||
name: Display results | ||
needs: [python_build, rust_build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
if: github.event_name == 'push' | ||
- uses: actions/checkout@v4 | ||
- name: Download all workflow run artifacts | ||
uses: actions/download-artifact@v3 | ||
- name: Commit the generated code | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git add ./python | ||
git diff --staged --quiet || git commit -s -m "Generated Python code" | ||
git add ./rust/astarte-message-hub-proto/src/astarteplatform.msghub.rs | ||
git diff --staged --quiet || git commit -s -m "Generated Rust code" | ||
git push | ||
git push |
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