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:
|
|
|
|
node-version: '16'
|
|
|
|
|
2023-04-25 17:21:14 +02:00
|
|
|
- name: Install dependencies
|
|
|
|
run: yarn
|
|
|
|
|
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-04-25 17:21:14 +02:00
|
|
|
npm run fitness-functions -- "ci" "./diff"
|