-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(common): add CI trigger for inventory
Signed-off-by: Mark Sanders <marksanders194@gmail.com>
- Loading branch information
Showing
2 changed files
with
85 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
name: 'OPI Inventory API CI' | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
paths-ignore: | ||
- 'common/v1/**' | ||
- 'common/Makefile' | ||
- 'inventory/v1/**' | ||
- 'inventory/Makefile' | ||
- '.github/workflows/inventory.yml' | ||
pull_request: | ||
branches: [ main ] | ||
paths-ignore: | ||
- 'common/v1/**' | ||
- 'common/Makefile' | ||
- 'inventory/v1/**' | ||
- 'inventory/Makefile' | ||
- '.github/workflows/inventory.yml' | ||
|
||
concurrency: | ||
# if workflow for PR or push is already running stop it, and start new one | ||
group: inventory-api-skip-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-inventory-protobuf: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'echo "No inventory API test run required"' |
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
name: 'OPI Inventory API CI' | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- 'common/v1/**' | ||
- 'common/Makefile' | ||
- 'inventory/v1/**' | ||
- 'inventory/Makefile' | ||
- '.github/workflows/inventory.yml' | ||
pull_request: | ||
branches: [ main ] | ||
paths: | ||
- 'common/v1/**' | ||
- 'common/Makefile' | ||
- 'inventory/v1/**' | ||
- 'inventory/Makefile' | ||
- '.github/workflows/inventory.yml' | ||
|
||
concurrency: | ||
# if workflow for PR or push is already running stop it, and start new one | ||
group: inventory-api-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-inventory-protobuf: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
# Workaround: https://github.com/docker/build-push-action/issues/461 | ||
- name: Setup Docker buildx | ||
uses: docker/setup-buildx-action@7703e82fbced3d0c9eec08dff4429c023a5fd9a9 | ||
|
||
- name: Build protobufs | ||
run: make | ||
working-directory: inventory | ||
|
||
- name: Check uncomitted auto generated protobufs | ||
run: git diff --exit-code | ||
working-directory: inventory | ||
|
||
- name: Upload build artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: inventory/v1/gen/go/*.pb.go | ||
retention-days: 1 |