rfd-processor: Bump npm lock dependencies #2695
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: Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-24.04 | |
| services: | |
| postgres: | |
| image: postgres | |
| env: | |
| POSTGRES_USER: test | |
| POSTGRES_PASSWORD: test | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: ruby/setup-ruby@6e5d382445ae5590b7449d8b3bc8cb1c2c27f617 # v1.3.7 | |
| with: | |
| working-directory: rfd-processor | |
| bundler-cache: true | |
| - name: Install PDF toolchain | |
| shell: bash | |
| working-directory: rfd-processor | |
| run: | | |
| bundle config set bin .bundle/bin | |
| bundle binstubs asciidoctor asciidoctor-pdf | |
| npm ci | |
| printf '%s\n' '{"args":["--no-sandbox"]}' > .bundle/bin/puppeteer.json | |
| printf '%s\n' '#!/usr/bin/env bash' \ | |
| "exec '$PWD/node_modules/.bin/mmdc' --puppeteerConfigFile '$PWD/.bundle/bin/puppeteer.json' \"\$@\"" \ | |
| > .bundle/bin/mmdc | |
| chmod +x .bundle/bin/mmdc | |
| echo "$PWD/.bundle/bin" >> "$GITHUB_PATH" | |
| - name: Report versions | |
| run: | | |
| asciidoctor --version | |
| asciidoctor-pdf --version | |
| mmdc --version | |
| - run: | | |
| rustup toolchain install | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| - run: | | |
| cargo test | |
| env: | |
| TEST_DATABASE: postgres://test:test@localhost | |
| RUST_LOG: v=trace,rfd=trace | |
| - name: Verify RFD 9999 PDF fixture | |
| shell: bash | |
| run: | | |
| expected_pdf="rfd-processor/tests/rfd_9999.pdf" | |
| generated_pdf="rfd-processor/tests/rfd_9999-generated.pdf" | |
| diff_pdf="rfd-processor/tests/rfd_9999-diff.pdf" | |
| cargo run --profile test -p rfd-processor -- pdf rfd-processor/tests/rfd_9999 -o "$generated_pdf" | |
| expected_checksum="$(sha256sum "$expected_pdf" | cut -d ' ' -f 1)" | |
| generated_checksum="$(sha256sum "$generated_pdf" | cut -d ' ' -f 1)" | |
| if [[ "$expected_checksum" != "$generated_checksum" ]]; then | |
| echo "Rendered PDF does not match checked-in RFD 9999 PDF" | |
| sudo apt-get update | |
| sudo apt-get install -y diff-pdf-wx xvfb | |
| xvfb-run -a diff-pdf --skip-identical --mark-differences "$expected_pdf" "$generated_pdf" --output-diff "$diff_pdf" || true | |
| exit 1 | |
| fi | |
| - name: Upload rendered PDF | |
| if: failure() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: rfd-processor-rfd-9999-pdf-artifacts | |
| path: | | |
| rfd-processor/tests/rfd_9999-generated.pdf | |
| rfd-processor/tests/rfd_9999-diff.pdf | |
| if-no-files-found: ignore | |
| generate: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - run: | | |
| rustup toolchain install | |
| rustup toolchain install nightly --component rustfmt | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| - name: Install Dprint | |
| run: | | |
| mkdir -p "$HOME/.dprint/bin" | |
| curl -fsSL \ | |
| "https://github.com/dprint/dprint/releases/download/${DPRINT_VERSION}/${DPRINT_ASSET}" \ | |
| > "$HOME/.dprint/bin/${DPRINT_ASSET}" | |
| cd "$HOME/.dprint/bin" | |
| echo "${DPRINT_HASH} ${DPRINT_ASSET}" | sha256sum --check | |
| unzip "${DPRINT_ASSET}" | |
| rm "${DPRINT_ASSET}" | |
| echo "/home/runner/.dprint/bin" >> "$GITHUB_PATH" | |
| env: | |
| DPRINT_VERSION: 0.53.0 | |
| DPRINT_HASH: 987185f5f0db6205e5bca88aaab04a7b29bc18bf7a8c1a84f56eef08c9730df0 | |
| DPRINT_ASSET: dprint-x86_64-unknown-linux-gnu.zip | |
| - name: Verify SDK Generation | |
| run: | | |
| cargo xtask generate | |
| GENERATED="rfd-api-spec.json rfd-sdk/src/generated/ rfd-cli/src/generated/ rfd-ts/" | |
| if ! git diff --quiet -- "$GENERATED"; then | |
| git diff -- "$GENERATED" | |
| echo "Found changed files after generating SDKs:" | |
| git status -s -- "$GENERATED" | |
| echo "To fix, regenerate with, commit the changes from running:" | |
| echo " cargo xtask generate" | |
| exit 1 | |
| fi |