build(deps-dev): bump eslint-config-prettier from 8.9.0 to 9.0.0 in /frontend/octavio #220
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: 'E2E Tests' | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
env: | |
MARIADB_VERSION: 10.5.10 | |
REDIS_VERSION: 6.2.4 | |
MINIO_VERSION: RELEASE.2023-07-21T21-12-44Z | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- name: index | |
- name: login | |
dependencies: [ictsc-rikka] | |
- name: notices | |
dependencies: [ictsc-rikka] | |
- name: profile | |
dependencies: [ictsc-rikka] | |
- name: ranking | |
dependencies: [ictsc-rikka] | |
- name: signUp | |
dependencies: [ictsc-rikka] | |
- name: team_info | |
dependencies: [ictsc-rikka] | |
- name: users | |
dependencies: [ictsc-rikka] | |
- name: problems/problemId | |
dependencies: [ictsc-rikka] | |
- name: problems/index | |
dependencies: [ictsc-rikka] | |
- name: scoring/code | |
dependencies: [ictsc-rikka] | |
- name: scoring/index | |
dependencies: [ictsc-rikka] | |
- name: components/navbar | |
dependencies: [ictsc-rikka] | |
steps: | |
- name: Set Timezone | |
run: sudo timedatectl set-timezone Asia/Tokyo | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8.6.10 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
cache: 'pnpm' | |
cache-dependency-path: frontend/octavio/pnpm-lock.yaml | |
- name: Install dependencies | |
working-directory: frontend/octavio | |
run: pnpm i --frozen-lockfile | |
- name: Cache font build | |
id: cache-font | |
uses: actions/cache@v3 | |
with: | |
path: frontend/octavio/app/dist/fonts | |
key: font-${{ hashFiles('frontend/octavio/Dockerfile') }} | |
- name: Build Font | |
if: steps.cache-font.outputs.cache-hit != 'true' | |
working-directory: frontend/octavio | |
run: pnpm font | |
- name: Get installed Playwright version | |
id: playwright-version | |
working-directory: frontend/octavio | |
run: echo "PLAYWRIGHT_VERSION=$(node -e "process.stdout.write(require('@playwright/test/package.json').version)")" >> $GITHUB_OUTPUT | |
- name: Cache install Playwright | |
id: cache-playwright | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/ms-playwright | |
key: playwright-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }} | |
- name: Install Playwright | |
if: steps.cache-playwright.outputs.cache-hit != 'true' | |
working-directory: frontend/octavio | |
run: npx playwright install --with-deps chromium | |
- name: Set env | |
working-directory: frontend/octavio | |
run: | | |
cat <<EOF > .env.local | |
NEXT_PUBLIC_API_URL=http://localhost:8080/api | |
NEXT_PUBLIC_ANSWER_LIMIT=20 | |
NEXT_PUBLIC_SITE_NAME=ICTSC | |
RULE=## ルール本文 | |
NEXT_PUBLIC_SHORT_RULE=## 短いルール本文 | |
NEXT_PUBLIC_RECREATE_RULE=## 再展開ルール本文 | |
EOF | |
# | |
# define start ictsc-rikka steps | |
# | |
- name: Checkout ictsc-rikka repository | |
if: contains(matrix.dependencies, 'ictsc-rikka') | |
uses: actions/checkout@v3 | |
with: | |
repository: ictsc/ictsc-rikka | |
path: ictsc-rikka | |
# MariaDB cache | |
- name: Cache a MariaDB Docker image | |
if: contains(matrix.dependencies, 'ictsc-rikka') | |
id: cache-mariadb | |
uses: actions/cache@v3 | |
with: | |
path: mariadb-image | |
key: mariadb-${{ env.MARIADB_VERSION }} | |
- name: Pull and save a MariaDB Docker image | |
if: contains(matrix.dependencies, 'ictsc-rikka') && steps.cache-mariadb.outputs.cache-hit != 'true' | |
run: | | |
docker pull mariadb:${{ env.MARIADB_VERSION }} | |
docker save mariadb:${{ env.MARIADB_VERSION }} -o mariadb-image | |
- if: contains(matrix.dependencies, 'ictsc-rikka') | |
run: docker load -i mariadb-image | |
# Redis cache | |
- name: Cache a Redis Docker image | |
if: contains(matrix.dependencies, 'ictsc-rikka') | |
id: cache-redis | |
uses: actions/cache@v3 | |
with: | |
path: redis-image | |
key: redis-${{ env.REDIS_VERSION }} | |
- name: Pull and save a Redis Docker image | |
if: contains(matrix.dependencies, 'ictsc-rikka') && steps.cache-redis.outputs.cache-hit != 'true' | |
run: | | |
docker pull redis:${{ env.REDIS_VERSION }} | |
docker save redis:${{ env.REDIS_VERSION }} -o redis-image | |
- if: contains(matrix.dependencies, 'ictsc-rikka') | |
run: docker load -i redis-image | |
# Minio cache | |
- name: Cache a Minio Docker image | |
if: contains(matrix.dependencies, 'ictsc-rikka') | |
id: cache-minio | |
uses: actions/cache@v3 | |
with: | |
path: minio-image | |
key: minio-${{ env.MINIO_VERSION }} | |
- name: Pull and save a Minio Docker image | |
if: contains(matrix.dependencies, 'ictsc-rikka') && steps.cache-minio.outputs.cache-hit != 'true' | |
run: | | |
docker pull minio/minio:${{ env.MINIO_VERSION }} | |
docker save minio/minio:${{ env.MINIO_VERSION }} -o minio-image | |
- if: contains(matrix.dependencies, 'ictsc-rikka') | |
run: docker load -i minio-image | |
- name: Set env | |
if: contains(matrix.dependencies, 'ictsc-rikka') | |
working-directory: ictsc-rikka | |
run: | | |
cat <<EOF > cmd/rikka/config.docker.yaml | |
listen: | |
address: 0.0.0.0 | |
port: 8080 | |
cors: | |
origins: | |
- http://localhost:3000 | |
store: | |
secure: false | |
sameSiteStrictMode: lax | |
domain: | |
notify: | |
answer: http://localhost:8080 | |
## answerLimit (value * time.Minute) | |
contest: | |
answerLimit: 20 | |
mariadb: | |
address: mariadb | |
port: 3306 | |
username: rikka | |
password: rikka-password | |
database: rikka | |
redis: | |
idleConnectionSize: 10 | |
address: redis | |
port: 6379 | |
keyPair: secret | |
seed: | |
adminUserGroupAndUserSeeder: | |
userGroupName: admin-group | |
organization: admin-org | |
invitationCode: test-invitation-code | |
userName: admin | |
userPassword: password | |
minio: | |
endPoint: minio:9000 | |
accessKeyID: admin | |
secretAccessKey: adminadmin | |
useSSL: false | |
EOF | |
- name: Cache Docker Layer | |
if: contains(matrix.dependencies, 'ictsc-rikka') | |
uses: jpribyl/[email protected] | |
# Docker コンテナが起動してから、レスポンスが返ってくるまで待機する | |
# リトライは10回まで `/` にアクセスしてレスポンスのステータスコードをチェック | |
# - ステータスコードが `404` の場合は正常終了します | |
# - ステータスコードが `404` 以外の場合は、5秒間スリープしてリトライします | |
- name: Run rikka | |
if: contains(matrix.dependencies, 'ictsc-rikka') | |
working-directory: ictsc-rikka | |
run: | | |
set +e # curlのエラーを無視する | |
cp scripts/docker-compose.override.yml docker-compose.override.yml | |
make up | |
url="http://localhost:8080" | |
max_attempts=15 | |
sleep_interval=5 | |
for i in $(seq 1 $max_attempts); do | |
status=$(curl -o /dev/null -s -w '%{http_code}\n' $url) | |
if [ $status -eq 404 ]; then | |
echo "Container is ready! Response status code: $status" | |
exit 0 | |
else | |
echo "Attempt $i/$max_attempts: Response status code $status" | |
sleep $sleep_interval | |
fi | |
done | |
exit 1 | |
# | |
# define end ictsc-rikka steps | |
# | |
- name: Run tests | |
working-directory: frontend/octavio | |
run: npx playwright test __e2e__/${{ matrix.name }} |