Skip to content

Commit

Permalink
only run checks if files in relevant folders are changed
Browse files Browse the repository at this point in the history
  • Loading branch information
pygrum committed Dec 27, 2023
1 parent 01d3376 commit 50735dc
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
sources:
- 'pkg/**'
- 'cmd/**'
- 'scripts/**'
- uses: actions/setup-go@v4
if: steps.filter.outputs.sources == 'true'
with:
go-version: 1.21
- name: Build all Monarch clients
if: steps.filter.outputs.sources == 'true'
run: make linux macos windows

build-test-monarch:
Expand All @@ -26,19 +36,32 @@ jobs:
- "./scripts/docker-install-monarch.sh"
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
sources:
- 'pkg/**'
- 'cmd/**'
- 'scripts/**'
- 'docker/monarch/**'
- uses: actions/setup-go@v4
with:
go-version: 1.21

- name: Install Monarch
if: steps.filter.outputs.sources == 'true'
continue-on-error: false
run: bash ${{ matrix.install_script }}

- name: Setup Monarch Container
if: steps.filter.outputs.sources == 'true'
continue-on-error: false
run: docker build -t monarch -f docker/builder/Dockerfile .

- name: Run Monarch tests
if: steps.filter.outputs.sources == 'true'
run: go test ./...
- name: Cleanup
if: steps.filter.outputs.sources == 'true'
run: bash ./scripts/uninstall-monarch.sh
16 changes: 16 additions & 0 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,30 @@ jobs:
IMAGE_VERSION: latest # just for test
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
sources:
- 'pkg/**'
- 'cmd/**'
- 'scripts/**'
- 'docker/builder/**'
python:
- 'python/**'
- name: Set up Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
if: steps.filter.outputs.sources == 'true'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push
uses: docker/build-push-action@v3
if: steps.filter.outputs.sources == 'true'
with:
context: .
push: false
Expand All @@ -31,9 +44,12 @@ jobs:

- name: Install python package
uses: actions/setup-python@v4
if: steps.filter.outputs.python == 'true'
continue-on-error: false

- name: upgrade pip packages
if: steps.filter.outputs.python == 'true'
run: python3 -m pip install --user --upgrade setuptools wheel twine
- name: setup distribution
if: steps.filter.outputs.python == 'true'
run: python3 python/setup.py sdist bdist_wheel

0 comments on commit 50735dc

Please sign in to comment.