-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
115 additions
and
228 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
NODE_ENV=test | ||
NODE_PORT=3003 | ||
POSTGRES_USER=root | ||
POSTGRES_DB=momentum | ||
POSTGRES_PASSWORD=root | ||
POSTGRES_PORT=5432 | ||
DATABASE_URL=postgresql://root:root@db/momentum?schema=public | ||
MINIO_ROOT_USER=minio | ||
MINIO_ROOT_PASSWORD=minio123 | ||
STORAGE_REGION=us-west-1 | ||
STORAGE_BUCKET_NAME=momtest | ||
STORAGE_ACCESS_KEY_ID=minio | ||
STORAGE_SECRET_ACCESS_KEY=minio123 | ||
STORAGE_ENDPOINT_URL=http://minio:9000 | ||
STEAM_WEB_API_KEY=thisisenoughtogenerateanopenidreferralforsomereason | ||
SESSION_SECRET=thisisashitsecretdontuseitinprod | ||
JWT_SECRET=thisisalsonotasecure |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,131 +1,84 @@ | ||
name: Tests and Linting | ||
|
||
name: Code Quality | ||
on: | ||
pull_request: | ||
branches: | ||
- staging | ||
- nestJS # TODO: Remove when done | ||
paths-ignore: | ||
- '**.md' | ||
|
||
# TODO: Client stuff will need upgrading when NestJS rewrite is completed. | ||
- main | ||
jobs: | ||
# client-lint: | ||
# name: Client Lint | ||
# runs-on: ubuntu-latest | ||
# | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v2 | ||
# | ||
# - name: Get specific changed files | ||
# id: changed-files-specific | ||
# uses: tj-actions/changed-files@v12 | ||
# with: | ||
# files: client\/.*\.(js|ts|scss|html)$ | ||
# | ||
# - name: Setup Node | ||
# if: steps.changed-files-specific.outputs.any_changed == 'true' | ||
# uses: actions/setup-node@v1 | ||
# with: | ||
# node-version: "12.x" | ||
# | ||
# - name: Resolve Yarn Cache Directory | ||
# if: steps.changed-files-specific.outputs.any_changed == 'true' | ||
# id: yarn-cache-dir-path | ||
# run: echo "::set-output name=dir::$(yarn cache dir)" | ||
# | ||
# - name: Cache Yarn Cache Directory | ||
# if: steps.changed-files-specific.outputs.any_changed == 'true' | ||
# uses: actions/cache@v2 | ||
# with: | ||
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
# key: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ hashFiles('./client/yarn.lock') }} | ||
# restore-keys: ${{ runner.os }}-${{ env.NODE_VERSION }}- | ||
# | ||
# - name: Run Lint | ||
# if: steps.changed-files-specific.outputs.any_changed == 'true' | ||
# run: | | ||
# cd ./client/ | ||
# npm install -g @angular/cli && yarn install --prefer-offline | ||
# npm run lint:ci | ||
# | ||
# client-tests: | ||
# name: Client Tests | ||
# runs-on: ubuntu-latest | ||
# | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v2 | ||
# | ||
# - name: Get specific changed files | ||
# id: changed-files-specific | ||
# uses: tj-actions/changed-files@v12 | ||
# with: | ||
# files: .(ts)$ | ||
# | ||
# - name: Setup Node | ||
# if: steps.changed-files-specific.outputs.any_changed == 'true' | ||
# uses: actions/setup-node@v1 | ||
# with: | ||
# node-version: "12.x" | ||
# | ||
# - name: Resolve Yarn Cache Directory | ||
# if: steps.changed-files-specific.outputs.any_changed == 'true' | ||
# id: yarn-cache-dir-path | ||
# run: echo "::set-output name=dir::$(yarn cache dir)" | ||
# | ||
# - name: Cache Yarn Cache Directory | ||
# if: steps.changed-files-specific.outputs.any_changed == 'true' | ||
# uses: actions/cache@v2 | ||
# with: | ||
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
# key: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ hashFiles('./client/yarn.lock') }} | ||
# restore-keys: ${{ runner.os }}-${{ env.NODE_VERSION }}- | ||
# | ||
# - name: Run Tests | ||
# if: steps.changed-files-specific.outputs.any_changed == 'true' | ||
# run: | | ||
# cd ./client/ | ||
# npm install -g @angular/cli && yarn install --prefer-offline | ||
# npm run test | ||
# | ||
backend-lint: | ||
name: Backend Lint/Formatting | ||
install-deps: | ||
name: Install Dependencies | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/cache@v3 | ||
id: cache | ||
with: | ||
path: node_modules | ||
key: modules-${{ hashFiles('package-lock.json') }} | ||
- uses: actions/setup-node@v3 | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
with: | ||
node-version: 18 | ||
node-version: 18.x | ||
cache: 'npm' | ||
cache-dependency-path: server/package-lock.json | ||
|
||
- name: Install packages | ||
working-directory: server | ||
run: npm install | ||
|
||
- name: npm install | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: npm ci --no-scripts | ||
lint: | ||
name: Linting and Formatting | ||
runs-on: ubuntu-latest | ||
needs: install-deps | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: node_modules | ||
key: modules-${{ hashFiles('package-lock.json') }} | ||
- run: git fetch --no-tags --prune --depth=1 origin main | ||
- name: commitlint | ||
if: github.event_name == 'pull_request' | ||
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose | ||
- name: Prettier | ||
working-directory: server | ||
run: npm run format:check | ||
|
||
run: npx nx format:check --base=origin/main | ||
- name: ESLint | ||
working-directory: server | ||
run: npm run lint:check | ||
|
||
backend-tests: | ||
name: Backend Tests | ||
run: npx nx affected --target=lint --base=origin/main --parallel=3 | ||
test: | ||
name: Unit Tests | ||
runs-on: ubuntu-latest | ||
needs: install-deps | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Cache node_modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: node_modules | ||
key: modules-${{ hashFiles('package-lock.json') }} | ||
- run: git fetch --no-tags --prune --depth=1 origin main | ||
- run: npx nx affected --target=test --base=origin/main --parallel=3 | ||
e2e: | ||
name: E2E Tests | ||
runs-on: ubuntu-latest | ||
needs: install-deps | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get changed files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v35 | ||
- uses: actions/checkout@v3 | ||
- name: Cache node_modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: node_modules | ||
key: modules-${{ hashFiles('package-lock.json') }} | ||
- name: Launch Docker containers | ||
run: | ||
docker compose | ||
-f docker-compose.yml -f docker-compose.test.yml | ||
run e2e-tests | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
needs: install-deps | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Cache node_modules | ||
uses: actions/cache@v3 | ||
with: | ||
files: server/**/*.{ts,js,prisma} | ||
|
||
- name: Execute tests | ||
if: steps.changed-files.outputs.any_changed == 'true' | ||
run: docker compose -f docker-compose.yml -f docker-compose.test.yml up --build --exit-code-from api | ||
path: node_modules | ||
key: modules-${{ hashFiles('package-lock.json') }} | ||
- run: git fetch --no-tags --prune --depth=1 origin main | ||
- run: npx nx affected --target=build --base=origin/main --parallel=3 |
This file was deleted.
Oops, something went wrong.
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