Huilensolis is testing out feat(app): 91 run setup script and run tests #14
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 Api Tests | |
run-name: ${{ github.actor }} is testing out ${{ github.event.pull_request.title }} | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
environment: Preview | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest # or "latest", "canary", <sha> | |
- uses: KengoTODA/actions-setup-docker-compose@v1 | |
with: | |
version: "v2.24.1" # the full version of `docker-compose` command | |
- name: Install npm dependencies | |
run: bun i | |
working-directory: apps/api/ | |
- name: Create .env file | |
run: | | |
touch .env | |
echo PORT=3000 >> .env | |
echo JWT_SECRET="secret" >> .env | |
echo POSTGRES_DATABASE="memoir_db" >> .env | |
echo POSTGRES_USER="memoir_user" >> .env | |
echo POSTGRES_PASSWORD="memoir_password" >> .env | |
echo NODE_ENV="test" >> .env | |
echo WEB_DOMAIN="localhost:3001" >> .env | |
echo API_URL="http://localhost:3000" >> .env | |
working-directory: apps/api/ | |
- name: Run set up environment script | |
run: bun run setup | |
working-directory: apps/api/ | |
- name: Run tests | |
run: bun run test | |
working-directory: apps/api/ |