Release/2025 01 05 #76
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: tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- develop | |
# Typescript and our jest tests will fail in the workflow since there are missing config files | |
# To fix this, we need to manually load them to their respected files | |
# Initially used secret variables to do this but decided to just hard code the declarations for simpler setup | |
# We dont really need to add values to the variables, just need them defined in a file | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: 'Run lint checks' | |
run: 'yarn lint' | |
typescript: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
- name: Create config folder | |
run: mkdir src/config | |
- name: Load environment config | |
run: > | |
echo "export const ENV = 'dev'; export const BOT_TOKEN = ''; export const MIXPANEL_ID = ''; export const TOP_GG_TOKEN = ''; | |
export const GUILD_IDS = ''; export const GUILD_NOTIFICATION_WEBHOOK_URL = ''; export const USE_DATABASE = false; | |
export const ERROR_NOTIFICATION_WEBHOOK_URL = ''; export const BOOT_NOTIFICATION_CHANNEL_ID = ''; export const BOT_ID = ''; | |
export const FLAGSMITH_KEY = '';" | |
> src/config/environment.ts | |
- name: Load database config | |
run: echo "export const databaseConfig = {};" > src/config/database.ts | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Run Typescript checks | |
run: yarn tsc --noEmit | |
jest: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Set up Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
- name: Create config folder | |
run: mkdir src/config | |
- name: Load environment config | |
run: > | |
echo "export const ENV = 'dev'; export const BOT_TOKEN = ''; export const MIXPANEL_ID = ''; export const TOP_GG_TOKEN = ''; | |
export const GUILD_IDS = ''; export const GUILD_NOTIFICATION_WEBHOOK_URL = ''; export const USE_DATABASE = false; | |
export const ERROR_NOTIFICATION_WEBHOOK_URL = ''; export const BOOT_NOTIFICATION_CHANNEL_ID = ''; export const BOT_ID = ''; | |
export const FLAGSMITH_KEY = '';" | |
> src/config/environment.ts | |
- name: Load database config | |
run: echo "export const databaseConfig = {};" > src/config/database.ts | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Run Jest tests | |
run: yarn jest |