-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): update CI to use new docker container workflow
- Loading branch information
Showing
6 changed files
with
134 additions
and
131 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,29 @@ | ||
TZ=UTC | ||
PORT=3333 | ||
HOST=localhost | ||
LOG_LEVEL=info | ||
APP_KEY=1234567890123456 | ||
NODE_ENV=test | ||
|
||
BYPASS_LOGIN=true | ||
|
||
SESSION_DRIVER=memory | ||
|
||
DB_CONNECTION=postgres | ||
DB_HOST=localhost | ||
DB_PORT=5432 | ||
DB_USER=postgres | ||
DB_PASSWORD=postgres | ||
DB_DATABASE=postgres | ||
|
||
REDIS_PASSWORD=1234 | ||
REDIS_HOST=localhost | ||
REDIS_PORT=6379 | ||
REDIS_DB=1 | ||
|
||
TWITCH_CLIENT_ID=client_id | ||
TWITCH_CLIENT_SECRET=client_secret | ||
TWITCH_CALLBACK_URL=http://localhost:3333/auth/twitch/callback | ||
|
||
# Game length in seconds | ||
GAME_LENGTH=90 |
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 |
---|---|---|
|
@@ -27,3 +27,6 @@ TWITCH_CALLBACK_URL= | |
|
||
# Game length in seconds | ||
GAME_LENGTH=90 | ||
|
||
|
||
|
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
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,91 @@ | ||
name: Tools CI | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
DOCKERHUB_USERNAME: | ||
required: true | ||
DOCKERHUB_PASSWORD: | ||
required: true | ||
|
||
env: | ||
COMPOSE_FILE_TOOLS: ./docker-compose.tools.yaml | ||
COMPOSE_FILE: ./docker-compose.yaml | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Run lint | ||
run: | | ||
docker compose -f ${{ env.COMPOSE_FILE_TOOLS }} run --rm install-node-deps | ||
docker compose -f ${{ env.COMPOSE_FILE_TOOLS }} run --rm biome-check | ||
typecheck: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Run typecheck | ||
run: | | ||
docker compose -f ${{ env.COMPOSE_FILE_TOOLS }} run --rm install-node-deps | ||
docker compose -f ${{ env.COMPOSE_FILE_TOOLS }} run --rm tsc | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Ensure /app/build is not in use | ||
run: | | ||
fuser -k /app/build || true | ||
- name: Run build | ||
run: | | ||
docker compose -f ${{ env.COMPOSE_FILE_TOOLS }} run --rm install-node-deps | ||
docker compose -f ${{ env.COMPOSE_FILE_TOOLS }} run --rm build | ||
tests: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Run tests | ||
run: | | ||
cp .env.ci .env | ||
docker compose -f ${{ env.COMPOSE_FILE }} up -d redis | ||
docker compose -f ${{ env.COMPOSE_FILE_TOOLS }} run --rm install-node-deps | ||
docker compose -f ${{ env.COMPOSE_FILE_TOOLS }} up -d postgres-test | ||
docker compose -f ${{ env.COMPOSE_FILE_TOOLS }} run --rm biome-check | ||
docker compose -f ${{ env.COMPOSE_FILE_TOOLS }} run --rm test |
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
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