2023-02-09 18:08:48 +01:00
|
|
|
name: Fitness Functions CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types: [assigned, opened, synchronize, reopened]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v3
|
2023-05-03 14:04:53 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2023-02-09 18:08:48 +01:00
|
|
|
|
|
|
|
- name: Use Node.js
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
2023-06-21 00:33:02 +02:00
|
|
|
node-version-file: '.nvmrc'
|
2023-06-26 13:35:53 +02:00
|
|
|
cache: yarn
|
2023-02-09 18:08:48 +01:00
|
|
|
|
2023-04-25 17:21:14 +02:00
|
|
|
- name: Install dependencies
|
2023-06-21 00:33:48 +02:00
|
|
|
run: yarn --immutable
|
2023-04-25 17:21:14 +02:00
|
|
|
|
2023-02-09 18:08:48 +01:00
|
|
|
- name: Run fitness functions
|
|
|
|
env:
|
|
|
|
BASE_REF: ${{ github.event.pull_request.base.ref }}
|
|
|
|
run: |
|
2023-05-03 14:04:53 +02:00
|
|
|
# The following command generates a diff of changes between the common
|
|
|
|
# ancestor of $BASE_REF and HEAD, and the current commit (HEAD), for
|
|
|
|
# files in the current directory and its subdirectories. The output is
|
|
|
|
# then saved to a file called "diff".
|
|
|
|
git diff "$(git merge-base "origin/$BASE_REF" HEAD)" HEAD -- . > ./diff
|
2023-06-21 00:33:02 +02:00
|
|
|
npm run fitness-functions -- "ci" "./diff"
|