Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
debug
Browse files Browse the repository at this point in the history
skamril committed Aug 14, 2024
1 parent 68a04c8 commit afdc65f
Showing 1 changed file with 52 additions and 7 deletions.
59 changes: 52 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -15,7 +15,29 @@ jobs:
## Python
################################################################

check-backend-changes:
runs-on: ubuntu-20.04
outputs:
should-run: ${{ steps.check-changes.outputs.should-run }}
steps:
- name: Checkout GitHub repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensure full history is fetched
- name: Check if backend files have changed
id: check-changes
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 -Eq '^antarest/|^tests/|^resources/|^requirements.*\.txt$'; then
echo "Backend files have changed"
echo "should-run=true" >> $GITHUB_OUTPUT
else
echo "No backend files have changed"
echo "should-run=false" >> $GITHUB_OUTPUT
fi
python-lint:
if: ${{ needs.check-backend-changes.outputs.should-run == 'true' }}
runs-on: ubuntu-20.04
steps:
- name: Checkout GitHub repo (+ download lfs dependencies)
@@ -44,6 +66,7 @@ jobs:
mypy --install-types --non-interactive
python-test:
if: ${{ needs.check-backend-changes.outputs.should-run == 'true' }}
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 9
@@ -78,8 +101,30 @@ jobs:
## npm
################################################################

check-frontend-changes:
runs-on: ubuntu-20.04
outputs:
should-run: ${{ steps.check-changes.outputs.should-run }}
steps:
- name: Checkout GitHub repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensure full history is fetched
- name: Check if front-end files have changed
id: check-changes
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 "Front-end files have changed"
echo "should-run=true" >> $GITHUB_OUTPUT
else
echo "No front-end files in 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
@@ -102,8 +147,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
@@ -123,8 +168,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
@@ -144,8 +189,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

0 comments on commit afdc65f

Please sign in to comment.