Skip to content

Commit

Permalink
chore(ci): only run website tests on website code changes
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusroemer committed Apr 29, 2024
1 parent 702f701 commit df6cdd1
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 42 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/website-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: website-tests

on:
push:
paths:
- "website/**"
- ".github/workflows/website-tests.yml"
workflow_dispatch:

concurrency:
group: ci-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}-website-tests
cancel-in-progress: true

jobs:
checks:
name: Check format and types
runs-on: codebuild-loculus-ci-${{ github.run_id }}-${{ github.run_attempt }}
timeout-minutes: 15
defaults:
run:
working-directory: ./website
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('website/**/package-lock.json') }}
- run: npm ci
- run: npm run check-format
- run: npm run check-types

unitTests:
name: Unit Tests
runs-on: codebuild-loculus-ci-${{ github.run_id }}-${{ github.run_attempt }}
timeout-minutes: 15
defaults:
run:
working-directory: ./website
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Cache .npm
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('website/**/package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run test
42 changes: 0 additions & 42 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,48 +12,6 @@ concurrency:
cancel-in-progress: true

jobs:
checks:
name: Check format and types
runs-on: codebuild-loculus-ci-${{ github.run_id }}-${{ github.run_attempt }}
timeout-minutes: 15
defaults:
run:
working-directory: ./website
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('website/**/package-lock.json') }}
- run: npm ci
- run: npm run check-format
- run: npm run check-types

unitTests:
name: Unit Tests
runs-on: codebuild-loculus-ci-${{ github.run_id }}-${{ github.run_attempt }}
timeout-minutes: 15
defaults:
run:
working-directory: ./website
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Cache .npm
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('website/**/package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run test

dockerImage:
name: Build Website Docker Image # Don't change: Referenced by .github/workflows/update-argocd-metadata.yml
runs-on: ubuntu-latest
Expand Down

0 comments on commit df6cdd1

Please sign in to comment.