Skip to content

Fix and improve pipeline for server and client #19

Fix and improve pipeline for server and client

Fix and improve pipeline for server and client #19

Workflow file for this run

name: CI Workflow
on:
push:
branches:
- main
paths:
- 'server/**'
- 'client/**'
pull_request:
branches:
- main
paths:
- 'server/**'
- 'client/**'
types:
- labeled
- synchronize
- opened
- reopened
permissions:
contents: read
jobs:
install_dependencies_server:
if: contains(github.event.pull_request.labels.*.name, 'server') || (github.event_name == 'push' && startsWith(github.ref, 'refs/heads/main') && github.event.commits.*.modified contains 'server/') || (github.event_name == 'pull_request' && github.event.pull_request.changed_files contains 'server/')

Check failure on line 27 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / CI Workflow

Invalid workflow file

The workflow is not valid. .github/workflows/main.yml (Line: 27, Col: 9): Unexpected symbol: 'contains'. Located at position 173 within expression: contains(github.event.pull_request.labels.*.name, 'server') || (github.event_name == 'push' && startsWith(github.ref, 'refs/heads/main') && github.event.commits.*.modified contains 'server/') || (github.event_name == 'pull_request' && github.event.pull_request.changed_files contains 'server/') .github/workflows/main.yml (Line: 49, Col: 9): Unexpected symbol: 'contains'. Located at position 173 within expression: contains(github.event.pull_request.labels.*.name, 'client') || (github.event_name == 'push' && startsWith(github.ref, 'refs/heads/main') && github.event.commits.*.modified contains 'client/') || (github.event_name == 'pull_request' && github.event.pull_request.changed_files contains 'client/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '20'
- name: Cache Node Modules
uses: actions/cache@v3
with:
path: |
server/node_modules
server/.yarn/cache
key: ${{ runner.os }}-node-${{ hashFiles('server/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies for Server
run: cd server && yarn --frozen-lockfile
install_dependencies_client:
if: contains(github.event.pull_request.labels.*.name, 'client') || (github.event_name == 'push' && startsWith(github.ref, 'refs/heads/main') && github.event.commits.*.modified contains 'client/') || (github.event_name == 'pull_request' && github.event.pull_request.changed_files contains 'client/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '20'
- name: Cache Node Modules
uses: actions/cache@v3
with:
path: |
client/node_modules
client/.yarn/cache
key: ${{ runner.os }}-node-${{ hashFiles('client/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies for Client
run: cd client && yarn --frozen-lockfile
run_tests_server:
if: contains(github.event.pull_request.labels.*.name, 'server') || (github.event_name == 'push' && startsWith(github.ref, 'refs/heads/main') && github.event.commits.*.modified contains 'server/') || (github.event_name == 'pull_request' && github.event.pull_request.changed_files contains 'server/')
runs-on: ubuntu-latest
needs: install_dependencies_server
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '20'
- name: Restore Node Modules Cache
uses: actions/cache@v3
with:
path: |
server/node_modules
server/.yarn/cache
key: ${{ runner.os }}-node-${{ hashFiles('server/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- name: Run Server Tests
run: cd server && yarn jest
run_tests_client:
if: contains(github.event.pull_request.labels.*.name, 'client') || (github.event_name == 'push' && startsWith(github.ref, 'refs/heads/main') && github.event.commits.*.modified contains 'client/') || (github.event_name == 'pull_request' && github.event.pull_request.changed_files contains 'client/')
runs-on: ubuntu-latest
needs: install_dependencies_client
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '20'
- name: Restore Node Modules Cache
uses: actions/cache@v3
with:
path: |
client/node_modules
client/.yarn/cache
key: ${{ runner.os }}-node-${{ hashFiles('client/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- name: Run Client Tests
run: cd client && yarn jest