Skip to content

Commit

Permalink
Scope pull-request workflows to paths
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrobertlloyd committed Nov 28, 2024
1 parent 4a5ce91 commit 90c08f4
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 68 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/analyse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Pull request

on: pull_request

jobs:
analyse:
name: Sonar analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Sonar analysis
uses: sonarsource/sonarcloud-github-action@master
with:
projectBaseDir: .
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
18 changes: 18 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Pull request

on: pull_request

jobs:
lint:
name: Code style checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint
68 changes: 0 additions & 68 deletions .github/workflows/pull-request.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Pull request

on:
pull_request:
paths:
- '/packages/**'
- '/tests/**'
- '/app/**'

jobs:
tests:
name: Javascript unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test

ui_tests:
name: Visual regression tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Run backstop
run: npm run backstop:ci

0 comments on commit 90c08f4

Please sign in to comment.