Fix npm script to run on Windows and Ubuntu without errors #279
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: Run Tests On Pull Request | |
on: | |
pull_request: | |
branches: [dev, main] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
- name: Setup Node.js v18 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
- name: Install Yarn to latest stable version | |
run: | | |
npx corepack enable | |
yarn set version stable | |
yarn cache clean | |
- name: Install Dependencies | |
run: yarn install | |
- name: setup environment variables (with opensearch) | |
run: | | |
echo "JWT_SECRET=${{ vars.TEST_JWT_SECRET }}" >> ./apps/api/.env.test | |
echo "OPENSEARCH_USE=true" >> ./apps/api/.env.test | |
echo "OPENSEARCH_NODE=http://localhost:9200" >> ./apps/api/.env.test | |
echo "OPENSEARCH_USERNAME=''" >> ./apps/api/.env.test | |
echo "OPENSEARCH_PASSWORD=''" >> ./apps/api/.env.test | |
- name: Run Tests | |
run: yarn test | |
- name: setup environment variables (without opensearch) | |
run: | | |
rm ./apps/api/.env.test | |
echo "JWT_SECRET=${{ vars.TEST_JWT_SECRET }}" >> ./apps/api/.env.test | |
echo "OPENSEARCH_USE=false" >> ./apps/api/.env.test | |
- name: Run Tests | |
run: yarn test |