diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000000..9305ca35b6 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,23 @@ +name: 'Lint code' + +on: + workflow_call: + inputs: {} + +jobs: + lint_backend_and_frontend: + name: 'Lint backend and frontend' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18 + - name: 'Install dependencies' + run: npm ci && cd services/frontend && npm ci && cd ../backend && npm ci + - name: 'Create symlink for shared' + run: ln -s $PWD/services/shared $PWD/services/backend/src/shared && ln -s $PWD/services/shared $PWD/services/frontend/src/shared + - name: 'Run Stylelint for CSS files' + run: npm run stylelint "services/frontend/src/**/*.css" + - name: 'Run ESLint for JS files' + run: npm run eslint -- --ext .jsx,.js services --report-unused-disable-directives diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index af563e692c..5523a2f8dd 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -14,21 +14,7 @@ on: jobs: lint_backend_and_frontend: - name: 'Lint backend and frontend' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 18 - - name: 'Install dependencies' - run: npm ci && cd services/frontend && npm ci && cd ../backend && npm ci - - name: 'Create symlink for shared' - run: ln -s $PWD/services/shared $PWD/services/backend/src/shared && ln -s $PWD/services/shared $PWD/services/frontend/src/shared - - name: 'Run Stylelint for CSS files' - run: npm run stylelint "services/frontend/src/**/*.css" - - name: 'Run ESLint for JS files' - run: npm run eslint -- --ext .jsx,.js services --report-unused-disable-directives + uses: ./.github/workflows/lint.yaml test_end_to_end: runs-on: ubuntu-latest diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 754a84f099..7ce699ddb6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -13,21 +13,7 @@ on: jobs: # === Static tests / linting === lint_backend_and_frontend: - name: 'Lint backend and frontend' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 18 - - name: 'Install dependencies' - run: npm ci && cd services/frontend && npm ci && cd ../backend && npm ci - - name: 'Create symlink for shared' - run: ln -s $PWD/services/shared $PWD/services/backend/src/shared && ln -s $PWD/services/shared $PWD/services/frontend/src/shared - - name: 'Run Stylelint for CSS files' - run: npm run stylelint "services/frontend/src/**/*.css" - - name: 'Run ESLint for JS and TS files' - run: npm run eslint -- --ext .js,.jsx,.ts,.tsx services --report-unused-disable-directives + uses: ./.github/workflows/lint.yaml # === Build database images === build_backend: