Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ Update dev dependencies + improve CI #14

Merged
merged 14 commits into from
Jul 30, 2024
51 changes: 50 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,67 @@ on:
branches: [main]

jobs:
build:
Build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
cache: npm
node-version-file: .node-version

- name: Install
run: npm ci

- name: CI build
run: npm run ci-build

Test:
name: Test (${{ matrix.node }} | ${{ matrix.platform.os }})
needs: Build # Verify ci-build first
defaults:
run:
shell: bash
runs-on: ${{ matrix.platform.os }}
strategy:
matrix:
node:
- 20.x
- 22.x
platform:
- os: ubuntu-latest
- os: macos-latest
- os: windows-latest
fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
cache: npm
node-version: ${{ matrix.node }}

- name: Install production
run: npm ci --include prod

- name: Build production
run: npm run build

- name: Run css-typed (the test)
# `node dist/main.js` is executing local `css-typed` as if installed (same as `bin`)
# Use `-I '//.*'` to ignore the first line (comment) which has generated path and timestamp
run: |
cp src/fixtures/kebab-case/kebab-case.css "$RUNNER_TEMP/kebab-case.css"

node dist/main.js "$RUNNER_TEMP/*.css"
diff --strip-trailing-cr -uI '//.*' src/fixtures/kebab-case/kebab-case-default.d.css.ts "$RUNNER_TEMP/kebab-case.d.css.ts"

node dist/main.js "$RUNNER_TEMP/*.css" --dashes
diff --strip-trailing-cr -uI '//.*' src/fixtures/kebab-case/kebab-case-dashes.d.css.ts "$RUNNER_TEMP/kebab-case.d.css.ts"
Loading