diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 00000000..4729ee98 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,64 @@ +name: CI - Lint, Typecheck & Test + +on: + pull_request: + +concurrency: + group: deploy-pipeline + cancel-in-progress: true + +jobs: + quality-assurance: + runs-on: docker + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v3 + with: + version: 10 + run_install: false + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: ๐Ÿ” Configure Private Registry + run: | + echo "@mintel:registry=https://git.infra.mintel.me/api/packages/mmintel/npm" > .npmrc + echo "//git.infra.mintel.me/api/packages/mmintel/npm/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc + + - name: Install dependencies + run: pnpm install --no-frozen-lockfile + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: ๐ŸŒ Install Chromium (Native) + run: | + apt-get update && apt-get install -y gnupg wget ca-certificates + mkdir -p /etc/apt/keyrings + KEY_ID="82BB6851C64F6880" + wget -qO- "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x$KEY_ID" | gpg --dearmor > /etc/apt/keyrings/xtradeb.gpg + echo "deb [signed-by=/etc/apt/keyrings/xtradeb.gpg] http://ppa.launchpad.net/xtradeb/apps/ubuntu focal main" > /etc/apt/sources.list.d/xtradeb-ppa.list + printf "Package: *\nPin: release o=LP-PPA-xtradeb-apps\nPin-Priority: 1001\n" > /etc/apt/preferences.d/xtradeb + apt-get update + apt-get install -y chromium + ln -sf /usr/bin/chromium /usr/bin/google-chrome + + - name: ๐Ÿงช QA Checks + env: + TURBO_TELEMETRY_DISABLED: "1" + PUPPETEER_EXECUTABLE_PATH: /usr/bin/chromium + run: npx turbo run check:mdx lint typecheck test --cache-dir=".turbo" + + - name: ๐Ÿ—๏ธ Build + run: pnpm build + + - name: โ™ฟ Accessibility Check + run: pnpm start-server-and-test start http://localhost:3000 "pnpm check:a11y http://localhost:3000" + + - name: โ™ฟ WCAG Sitemap Audit + run: pnpm start-server-and-test start http://localhost:3000 "pnpm run check:wcag http://localhost:3000" +# monitor trigger