Merge remote-tracking branch 'origin/develop' into production #435
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
name: Angular Tests | |
on: | |
push: | |
branches: | |
- '*' # Trigger on all branches | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 8 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 # This step checks out your repository's code | |
- name: Fetch develop branch | |
run: git fetch origin develop | |
- name: Check for changes in ./src | |
id: check_changes | |
run: | | |
echo "Checking for changes in ./src" | |
git diff --quiet origin/develop -- ./src && echo "::set-output name=changes_detected::false" || echo "::set-output name=changes_detected::true" | |
echo "Changes detected: ${{ steps.check_changes.outputs.changes_detected }}" | |
- name: Skip if no changes in ./src | |
run: | | |
if [ "${{ steps.check_changes.outputs.changes_detected }}" != 'true' ]; then | |
echo "No changes detected in ./src, skipping further steps" | |
exit 0 | |
fi | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20.x' # Updated Node.js version | |
- name: Install Angular CLI | |
run: yarn global add @angular/cli # Use Yarn to install Angular CLI | |
- name: Cache Yarn dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/yarn | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
run: yarn install # Use Yarn to install dependencies | |
- name: Run tests | |
run: yarn test-headless # Use Yarn to run tests |