Skip to content

untheory and i was right #625

untheory and i was right

untheory and i was right #625

Workflow file for this run

name: TPEN3 Services unit tests on any push
on:
push:
branches:
- '*'
- '!main'
- '!development'
jobs:
check_for_open_pr:
runs-on: ubuntu-latest
steps:
- name: Set the branch name as a processable string by making it an env variable.
run: echo BranchName=${GITHUB_REF##*/} >> $GITHUB_ENV
- name: Find Pull Request
uses: juliangruber/find-pull-request-action@v1
id: find-pull-request
with:
branch: ${{ env.BranchName }}
- name: Make the PR number a processable string. Output that string for the next job.
run: |
echo Name $BranchName
echo PRnumber=${{steps.find-pull-request.outputs.number}} >> $GITHUB_ENV
outputs:
number: ${{ env.PRnumber }}
test:
runs-on: ubuntu-latest
needs:
- check_for_open_pr
if: needs.check_for_open_pr.outputs.number == ''
steps:
- uses: actions/checkout@master
- name: Create .env from secrets
uses: SpicyPizza/create-envfile@v2
with:
envkey_DOWN: ${{ secrets.DOWN }}
envkey_READONLY: ${{ secrets.READONLY }}
envkey_SERVERURL: ${{ secrets.SERVERURL }}
envkey_MONGODBNAME: ${{ secrets.MONGODBNAME }}
envkey_MONGODB: ${{ secrets.MONGODB }}
envkey_TPENPROJECTS: ${{ secrets.TPENPROJECTS }}
envkey_TPENGROUPS: ${{ secrets.TPENGROUPS }}
envkey_TPENUSERS: ${{ secrets.TPENUSERS }}
envkey_MARIADBNAME: ${{ secrets.MARIADBNAME }}
envkey_MARIADB: ${{ secrets.MARIADB }}
envkey_MARIADBUSER: ${{ secrets.MARIADBUSERDEV }}
envkey_MARIADBPASSWORD: ${{ secrets.MARIADBPASSWORDDEV }}
envkey_RERUMURL: ${{ secrets.RERUMURL }}
envkey_RERUMIDPREFIX: ${{ secrets.RERUMIDPREFIXDEV }}
envkey_TINYPEN: ${{ secrets.TINYPENDEV }}
envkey_AUDIENCE: ${{ secrets.AUDIENCE }}
envkey_DOMAIN: ${{ secrets.DOMAIN }}
- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: "^22.12.0"
- name: Cache node modules
uses: actions/cache@master
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{
hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies and run the test
run: |
npm install
npm run unitTests