diff --git a/.gitea/workflows/ci-cd.yml b/.gitea/workflows/ci-cd.yml index ce2263365..6407a32e0 100644 --- a/.gitea/workflows/ci-cd.yml +++ b/.gitea/workflows/ci-cd.yml @@ -585,23 +585,36 @@ jobs: \ \\\n sh -lc 'npm ci'\n" - name: Run ESLint shell: sh - run: "set -eu\ndocker run --rm \\\n -v \"$PWD:/workspace\" \\\n -w /workspace/apps/web\ - \ \\\n docker.m.daocloud.io/library/node:20 \\\n sh -lc 'npx eslint src\ - \ --ext .ts,.tsx --max-warnings 50'\n" + run: "set -eu\nNPM_CACHE_VOLUME=\"xiaoxia-npm-cache\"\nif ! docker volume inspect\ + \ \"$NPM_CACHE_VOLUME\" >/dev/null 2>&1; then\n docker volume create \"$NPM_CACHE_VOLUME\"\ + \ >/dev/null\n echo \"Created npm cache volume: $NPM_CACHE_VOLUME\"\nfi\n\ + docker run --rm \\\n -v \"$PWD:/workspace\" \\\n -v \"$NPM_CACHE_VOLUME:/workspace/apps/web/node_modules\"\ + \ \\\n -w /workspace/apps/web \\\n docker.m.daocloud.io/library/node:20\ + \ \\\n sh -lc 'npx eslint src --ext .ts,.tsx --max-warnings 50'\n" - name: Run TypeScript type check shell: sh - run: "set -eu\ndocker run --rm \\\n -v \"$PWD:/workspace\" \\\n -w /workspace/apps/web\ - \ \\\n docker.m.daocloud.io/library/node:20 \\\n sh -lc 'npx tsc --noEmit'\n" + run: "set -eu\nNPM_CACHE_VOLUME=\"xiaoxia-npm-cache\"\nif ! docker volume inspect\ + \ \"$NPM_CACHE_VOLUME\" >/dev/null 2>&1; then\n docker volume create \"$NPM_CACHE_VOLUME\"\ + \ >/dev/null\n echo \"Created npm cache volume: $NPM_CACHE_VOLUME\"\nfi\n\ + docker run --rm \\\n -v \"$PWD:/workspace\" \\\n -v \"$NPM_CACHE_VOLUME:/workspace/apps/web/node_modules\"\ + \ \\\n -w /workspace/apps/web \\\n docker.m.daocloud.io/library/node:20\ + \ \\\n sh -lc 'npx tsc --noEmit'\n" - name: Run Prettier check shell: sh - run: "set -eu\ndocker run --rm \\\n -v \"$PWD:/workspace\" \\\n -w /workspace/apps/web\ - \ \\\n docker.m.daocloud.io/library/node:20 \\\n sh -lc 'npx prettier --check\ - \ \"src/**/*.{ts,tsx,md}\"'\n" + run: "set -eu\nNPM_CACHE_VOLUME=\"xiaoxia-npm-cache\"\nif ! docker volume inspect\ + \ \"$NPM_CACHE_VOLUME\" >/dev/null 2>&1; then\n docker volume create \"$NPM_CACHE_VOLUME\"\ + \ >/dev/null\n echo \"Created npm cache volume: $NPM_CACHE_VOLUME\"\nfi\n\ + docker run --rm \\\n -v \"$PWD:/workspace\" \\\n -v \"$NPM_CACHE_VOLUME:/workspace/apps/web/node_modules\"\ + \ \\\n -w /workspace/apps/web \\\n docker.m.daocloud.io/library/node:20\ + \ \\\n sh -lc 'npx prettier --check \"src/**/*.{ts,tsx,md}\"'\n" - name: Run Vitest tests shell: sh - run: "set -eu\ndocker run --rm \\\n -v \"$PWD:/workspace\" \\\n -w /workspace/apps/web\ - \ \\\n docker.m.daocloud.io/library/node:20 \\\n sh -lc 'npx vitest run\ - \ src/test'\n" + run: "set -eu\nNPM_CACHE_VOLUME=\"xiaoxia-npm-cache\"\nif ! docker volume inspect\ + \ \"$NPM_CACHE_VOLUME\" >/dev/null 2>&1; then\n docker volume create \"$NPM_CACHE_VOLUME\"\ + \ >/dev/null\n echo \"Created npm cache volume: $NPM_CACHE_VOLUME\"\nfi\n\ + docker run --rm \\\n -v \"$PWD:/workspace\" \\\n -v \"$NPM_CACHE_VOLUME:/workspace/apps/web/node_modules\"\ + \ \\\n -w /workspace/apps/web \\\n docker.m.daocloud.io/library/node:20\ + \ \\\n sh -lc 'npx vitest run src/test'\n" - name: Job duration summary if: always() shell: sh