Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
skamril committed Aug 14, 2024
1 parent 68a04c8 commit 72547ba
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,30 @@ jobs:
## npm
################################################################

check-frontend-changes:
runs-on: ubuntu-20.04
outputs:
should-run: ${{ steps.check-files.outputs.should-run }}
steps:
- name: Checkout GitHub repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensure full history is fetched
- name: Determine if files in 'webapp/' were changed
id: check-files
run: |
git fetch origin ${{ github.event.pull_request.base.ref }} --depth=1
if git diff --name-only origin/${{ github.event.pull_request.base.ref }}...HEAD | grep -q '^webapp/'; then
echo "Files in webapp/ have changed"
echo "should-run=true" >> $GITHUB_OUTPUT
else
echo "No files in webapp/ have changed"
echo "should-run=false" >> $GITHUB_OUTPUT
fi
npm-setup:
if: ${{ contains(github.event.pull_request.files.*.filename, 'webapp/') }}
needs: check-frontend-changes
if: ${{ needs.check-frontend-changes.outputs.should-run == 'true' }}
runs-on: ubuntu-20.04
steps:
- name: Checkout GitHub repo
Expand All @@ -102,8 +124,8 @@ jobs:
working-directory: webapp

npm-lint:
if: ${{ contains(github.event.pull_request.files.*.filename, 'webapp/') }}
needs: npm-setup
needs: [check-frontend-changes, npm-setup]
if: ${{ needs.check-frontend-changes.outputs.should-run == 'true' }}
runs-on: ubuntu-20.04
steps:
- name: Checkout GitHub repo
Expand All @@ -123,8 +145,8 @@ jobs:
working-directory: webapp

npm-test:
if: ${{ contains(github.event.pull_request.files.*.filename, 'webapp/') }}
needs: npm-setup
needs: [check-frontend-changes, npm-setup]
if: ${{ needs.check-frontend-changes.outputs.should-run == 'true' }}
runs-on: ubuntu-20.04
steps:
- name: Checkout GitHub repo
Expand All @@ -144,8 +166,8 @@ jobs:
working-directory: webapp

npm-build:
if: ${{ contains(github.event.pull_request.files.*.filename, 'webapp/') }}
needs: npm-setup
needs: [check-frontend-changes, npm-setup]
if: ${{ needs.check-frontend-changes.outputs.should-run == 'true' }}
runs-on: ubuntu-20.04
steps:
- name: Checkout GitHub repo
Expand Down

0 comments on commit 72547ba

Please sign in to comment.