Skip to content

Remove error logging #1122

Remove error logging

Remove error logging #1122

Workflow file for this run

name: CI
on:
pull_request:
branches:
- master
jobs:
setup:
if: |
!contains(github.event.pull_request.title, '[skip ci]') &&
!contains(github.event.head_commit.message, '[skip ci]')
name: Setup (Install Dependencies)
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Cache node_modules
id: node-modules-cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: npm ci
build:
name: Build
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Cached Dependencies
run: npm ci --prefer-offline
- name: Build
env:
NODE_ENV: production
PR_NUMBER: ${{ github.event.number }}
run: |
npm run generate-dictionary
npm run build
npm run build-sw
npm run build-manifest
npm run build-cache-list
- name: Upload dist folder as artifact
uses: actions/upload-artifact@v4
with:
name: dist-${{ github.event.number }}
path: dist/
retention-days: 1
lint:
name: Lint
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Cached Dependencies
run: npm ci --prefer-offline
- name: Lint
run: npm run lint
- name: Stylelint
run: npm run stylelint
test:
name: Tests:units
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Cached Dependencies
run: npm ci --prefer-offline
- name: Test
run: npm run test:unit
- name: Report
uses: kefasjw/lcov-pull-request-report@v1
with:
lcov-file: coverage/lcov.info
all-files-minimum-coverage: 10
github-token: ${{ secrets.GITHUB_TOKEN }}
pw-test:
name: Tests:playwright
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Cached Dependencies
run: npm ci --prefer-offline
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Download dist artifact
uses: actions/download-artifact@v4
with:
name: dist-${{ github.event.number }}
path: dist/
- name: Test
run: npm run test:pw
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
deploy-demo:
name: Deploy demo
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- uses: mdecoleman/[email protected]
id: vars
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Deployment pending
uses: chrnorm/deployment-action@releases/v1
id: deployment
with:
ref: ${{ steps.vars.outputs.branch }}
token: ${{ secrets.GITHUB_TOKEN }}
state: pending
environment: demo
- name: Use Cached Dependencies
run: npm ci --prefer-offline
- name: Download dist artifact
uses: actions/download-artifact@v4
with:
name: dist-${{ github.event.number }}
path: dist/
- name: Publish to Cloudflare Pages
id: deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_AUTH_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
command: pages deploy ./dist --project-name=${{ secrets.CF_PROJECT_NAME }} --branch=pr-${{ github.event.number }}
- name: Deployment success
uses: chrnorm/deployment-status@releases/v1
with:
state: success
token: ${{ secrets.GITHUB_TOKEN }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
environment_url: https://pr-${{ github.event.number }}.interslavic-dictionary.pages.dev/