Skip to content

ci: fix test runs

ci: fix test runs #7

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: "@ngx-tailwind/ui"
on:
push:
branches: [ "next", "release", "master" ]
paths: [ "projects/ngx-tailwind-ui/**", ".github/workflows/ngx-tailwind-ui.yml" ]
pull_request:
branches: [ "next" ]
paths: [ "projects/ngx-tailwind-ui/**" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
project: [ngx-tailwind-ui]
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: |
pnpm add @ngx-tailwind/core@file:projects/ngx-tailwind-core/src
sed "s/ngx-tailwind-//g" -i ./tsconfig.json
pnpm install
- name: Lint
run: pnpm lint:${{ matrix.project }}
- name: Build
run: pnpm build:${{ matrix.project }}
- name: Set CHROME_BIN environment variable
run: echo "CHROME_BIN=/home/runner/.cache/puppeteer/chrome/linux-132.0.6834.83/chrome-linux64/chrome" >> $GITHUB_ENV
- name: Test
run: >
pnpm install-chrome
pnpm test:${{ matrix.project }}:ci
- name: Publish test results summary
uses: janisz/action@v2
with:
paths: "junit/**/TESTS-*.xml"
- name: Publish artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.project }}-${{ github.run_id }}
path: "dist/${{ matrix.project }}"