Skip to content

Commit 24523d0

Browse files
authored
⬆️ Update dev dependencies + improve CI (#14)
Updates all dev dependencies to latest. Improves CI GitHub action to test on different node versions and platforms (OS).
1 parent d28abbf commit 24523d0

File tree

3 files changed

+831
-2187
lines changed

3 files changed

+831
-2187
lines changed

.github/workflows/ci.yaml

+50-1
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,67 @@ on:
77
branches: [main]
88

99
jobs:
10-
build:
10+
Build:
1111
name: Build
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v4
16+
1617
- name: Use Node.js
1718
uses: actions/setup-node@v4
1819
with:
1920
cache: npm
2021
node-version-file: .node-version
22+
2123
- name: Install
2224
run: npm ci
25+
2326
- name: CI build
2427
run: npm run ci-build
28+
29+
Test:
30+
name: Test (${{ matrix.node }} | ${{ matrix.platform.os }})
31+
needs: Build # Verify ci-build first
32+
defaults:
33+
run:
34+
shell: bash
35+
runs-on: ${{ matrix.platform.os }}
36+
strategy:
37+
matrix:
38+
node:
39+
- 20.x
40+
- 22.x
41+
platform:
42+
- os: ubuntu-latest
43+
- os: macos-latest
44+
- os: windows-latest
45+
fail-fast: false
46+
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v4
50+
51+
- name: Use Node.js ${{ matrix.node }}
52+
uses: actions/setup-node@v4
53+
with:
54+
cache: npm
55+
node-version: ${{ matrix.node }}
56+
57+
- name: Install production
58+
run: npm ci --include prod
59+
60+
- name: Build production
61+
run: npm run build
62+
63+
- name: Run css-typed (the test)
64+
# `node dist/main.js` is executing local `css-typed` as if installed (same as `bin`)
65+
# Use `-I '//.*'` to ignore the first line (comment) which has generated path and timestamp
66+
run: |
67+
cp src/fixtures/kebab-case/kebab-case.css "$RUNNER_TEMP/kebab-case.css"
68+
69+
node dist/main.js "$RUNNER_TEMP/*.css"
70+
diff --strip-trailing-cr -uI '//.*' src/fixtures/kebab-case/kebab-case-default.d.css.ts "$RUNNER_TEMP/kebab-case.d.css.ts"
71+
72+
node dist/main.js "$RUNNER_TEMP/*.css" --dashes
73+
diff --strip-trailing-cr -uI '//.*' src/fixtures/kebab-case/kebab-case-dashes.d.css.ts "$RUNNER_TEMP/kebab-case.d.css.ts"

0 commit comments

Comments
 (0)