server route for getpercentile method #2797
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit tests | |
on: | |
push: | |
branches: | |
- master | |
- fake-master | |
paths-ignore: | |
- '**.md' | |
- '**.txt' | |
- '.**ignore' | |
- 'docs/**' | |
pull_request: | |
types: [ opened, synchronize, reopened, ready_for_review ] | |
paths-ignore: | |
- '**.md' | |
- '**.txt' | |
- '.**ignore' | |
- 'docs/**' | |
workflow_call: {} | |
jobs: | |
build: | |
if: (github.event_name == 'workflow_call') || (github.event_name == 'push' && github.event.head_commit.author.email != 'PPTeam@STJUDE.ORG') || (github.event_name == 'pull_request' && github.event.pull_request.draft == false) | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 10 | |
- uses: actions/setup-node@v3 | |
with: | |
cache: 'npm' | |
node-version: '16' | |
- run: npm ci | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run ESLint | |
run: npx eslint . --ext .ts | |
- name: Copy serverconfig.json to root | |
run: | | |
cd server/test/ | |
node -e 'const fs = require("fs"); const serverconfig = JSON.parse(fs.readFileSync("serverconfig.json")); tpmasterdir = "/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/server/test/tp"; fs.writeFileSync("data.json", JSON.stringify(serverconfig));' | |
TPMASTERDIR=$(node -p "require('./serverconfig.json').tpmasterdir") | |
mv serverconfig.json ../../ | |
- name: Create server cache folder | |
run: mkdir server/cache | |
- name: Detect workspaces to test | |
run: | | |
# default to running tests on all workspaces, in case there is an error in requiresTest | |
echo "WS_TO_TEST=client server rust" >> $GITHUB_ENV | |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
# override with only the workspaces that have relevant changes | |
echo "WS_TO_TEST=$(./build/requiresTest.sh)" >> $GITHUB_ENV | |
fi | |
- name: 🔎 Run client tests | |
if: contains(env.WS_TO_TEST, 'client') | |
run: | | |
sudo apt-get install xvfb | |
xvfb-run --auto-servernum npm run test:unit --workspace="client" | |
- name: 🔎 Run augen tests | |
if: contains(env.WS_TO_TEST, 'augen') | |
run: | | |
npm test --workspace="augen" | |
- name: 🔎 Server unit tests | |
if: contains(env.WS_TO_TEST, 'server') | |
run: npm run test:unit --workspace="server" | |
- name: ⚡ Cache | |
if: contains(env.WS_TO_TEST, 'rust') | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
./rust/target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- uses: actions-rs/toolchain@v1 | |
if: contains(env.WS_TO_TEST, 'rust') | |
with: | |
toolchain: stable | |
- name: 🔎 Rust unit tests | |
if: contains(env.WS_TO_TEST, 'rust') | |
run: | | |
npm run build --workspace="rust" | |
npm run test:unit --workspace="rust" |