Skip to content

Commit

Permalink
refactor(common): add CI trigger for inventory
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Sanders <marksanders194@gmail.com>
  • Loading branch information
sandersms committed Oct 10, 2023
1 parent 20ee2b7 commit 53642ee
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/inventory-skip.yml
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"'
54 changes: 54 additions & 0 deletions .github/workflows/inventory.yml
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

0 comments on commit 53642ee

Please sign in to comment.