chore: 🤖 Add strict .npmrc
file
#637
Workflow file for this run
This file contains hidden or 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: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_call: # Allow this workflow to be called by other workflows | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-24.04 | |
permissions: | |
contents: read | |
strategy: | |
matrix: | |
node-version: [22, 24] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v5 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
run_install: false | |
- name: Setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm install | |
- name: Run tests | |
run: pnpm test | |
- name: Upload test coverage | |
if: matrix.node-version == '24' | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: false | |
build: | |
name: Build | |
runs-on: ubuntu-24.04 | |
needs: test | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v5 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
run_install: false | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build package | |
run: pnpm run build | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: | | |
packages/css-if-polyfill/dist | |
packages/postcss-if-function/dist | |
packages/lightningcss-plugin-if-function/dist | |
packages/stylelint-config-if-function/dist | |
retention-days: 30 | |
- name: Upload examples | |
uses: actions/upload-artifact@v4 | |
with: | |
name: examples | |
path: examples/ | |
retention-days: 30 | |
lint-markdown: | |
name: Lint Markdown | |
runs-on: ubuntu-24.04 | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v5 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
run_install: false | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm install | |
- name: Lint Markdown files | |
run: pnpm run lint:markdownlint |