Skip to content

ci: add pfs-tool smoke-test job to ci-pfs.yml #56

ci: add pfs-tool smoke-test job to ci-pfs.yml

ci: add pfs-tool smoke-test job to ci-pfs.yml #56

Workflow file for this run

name: CI / TypeScript
on:
push:
branches: [master]
pull_request:
branches: [master]
defaults:
run:
working-directory: implementations/ts
jobs:
build:
name: typecheck & build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: implementations/ts/package-lock.json
- run: npm ci
- run: npm run build -w @kduma-oss/pcf
- run: npm run build -w @kduma-oss/pcf-sig
test:
name: test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: implementations/ts/package-lock.json
- run: npm ci
- run: npm test -w @kduma-oss/pcf
# pcf-sig imports the compiled @kduma-oss/pcf dist/; build pcf first
# so the workspace dependency resolves before vitest runs.
- run: npm run build -w @kduma-oss/pcf
- run: npm test -w @kduma-oss/pcf-sig
test-vector:
name: regenerate spec test vector
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: implementations/ts/package-lock.json
- run: npm ci
- name: Build PCF (required before pcf-sig can import @kduma-oss/pcf)
run: npm run build -w @kduma-oss/pcf
- name: Build and run the PCF test-vector example
run: npm run gen-testvector -w @kduma-oss/pcf -- pcf_testvector.bin
- name: Inspect PCF test vector
run: |
ls -l pcf/pcf_testvector.bin
test "$(wc -c < pcf/pcf_testvector.bin)" = "395"
- name: Build and run the PCF-SIG test-vector example
run: npm run gen-testvector -w @kduma-oss/pcf-sig -- pcfsig_testvector.bin
- name: Inspect PCF-SIG test vector
run: |
ls -l pcf-sig/pcfsig_testvector.bin
test "$(wc -c < pcf-sig/pcfsig_testvector.bin)" = "966"
- uses: actions/upload-artifact@v4
with:
name: pcf-testvector-ts
path: |
implementations/ts/pcf/pcf_testvector.bin
implementations/ts/pcf-sig/pcfsig_testvector.bin
coverage:
name: code coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: implementations/ts/package-lock.json
- run: npm ci
- name: Generate PCF coverage report (enforces >=95% line / 100% function)
run: npm run coverage -w @kduma-oss/pcf
- name: Build PCF (required before pcf-sig can import @kduma-oss/pcf)
run: npm run build -w @kduma-oss/pcf
- name: Generate PCF-SIG coverage report (enforces >=90% line / 100% function)
run: npm run coverage -w @kduma-oss/pcf-sig
- uses: actions/upload-artifact@v4
with:
name: coverage-lcov-ts
path: |
implementations/ts/pcf/coverage/lcov.info
implementations/ts/pcf-sig/coverage/lcov.info