Skip to content

♻️ Run bin for pipeline tests #119

♻️ Run bin for pipeline tests

♻️ Run bin for pipeline tests #119

Workflow file for this run

name: Pipeline
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
CiBuild:
name: CI Build
uses: connorjs/github-workflows/.github/workflows/npm-ci-build~v1.yaml@main
Publish:
name: Publish
needs:
- CiBuild
- PipelineTests # Requires passing tests
uses: connorjs/github-workflows/.github/workflows/npm-publish~v1.yaml@main
with:
npmPackFilename: ${{ needs.CiBuild.outputs.npmPackFilename }}
semVer: ${{ needs.CiBuild.outputs.semVer }}
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
permissions:
contents: write
id-token: write
PipelineTests:
name: Test (${{ matrix.node }} | ${{ matrix.platform.os }})
needs:
- CiBuild
runs-on: ${{ matrix.platform.os }}-latest
defaults:
run:
shell: bash
strategy:
matrix:
node:
- 20.x
- 22.x
platform:
- os: ubuntu
- os: macos
- os: windows
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 css-typed
run: |
mkdir -p sandbox
cd sandbox
npm install ${{ needs.CiBuild.outputs.npmPackFilename }}
- name: "Test 1: default case"
run: |
scripts/test.sh foo '' '*.css'
- name: "Test 2: localsConvention, first position"
if: success() || failure()
run: |
scripts/test.sh casing/casing '' '--localsConvention camelCaseOnly *.css' casing/camelCaseOnly
- name: "Test 3: localsConvention, second position"
if: success() || failure()
run: |
scripts/test.sh casing/casing '' '*.css --localsConvention camelCaseOnly' casing/camelCaseOnly
- name: "Test 4: relative outdir"
if: success() || failure()
run: |
scripts/test.sh foo '' '--outdir generated *.css' '' generated/
- name: "Test 5: absolute outdir"
if: success() || failure()
run: |
scripts/test.sh foo "" "-o $RUNNER_TEMP/generated *.css" "" "$RUNNER_TEMP"/generated/
# Note: This test uses double quotes, which expands differently.
- name: "Test 6: json file config"
if: success() || failure()
run: |
scripts/test.sh foo csstypedrc.json
- name: "Test 7: yaml file config"
if: success() || failure()
run: |
scripts/test.sh foo csstypedrc.yaml '' '' generated/
- name: "Test 8: custom config path"
if: success() || failure()
run: |
scripts/test.sh foo css-typed-rc.yaml '-c .config/css-typed-rc.yaml'
- name: "Test 9: mjs file config"
if: matrix.platform.os != 'windows' && (success() || failure())
# Do not run on Windows due to Windows-only ESM import bug.
# This _could_ be an issue with css-typed, but could be a test/deps issue.
run: |
scripts/test.sh foo custom-config-path.config.mjs '-c .config/custom-config-path.config.mjs'