style: unify six terms that were split roughly down the middle #129
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: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: {} | |
| jobs: | |
| build: | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install verified Pandoc 3.5 | |
| env: | |
| PANDOC_VERSION: "3.5" | |
| PANDOC_SHA256: "4f41d817d262ef3d17953a3e6e0fefddb971aa4f2f121544a9a86db449d945e1" | |
| run: | | |
| package="$RUNNER_TEMP/pandoc-${PANDOC_VERSION}-1-amd64.deb" | |
| curl -fsSL --retry 3 \ | |
| "https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-1-amd64.deb" \ | |
| -o "$package" | |
| echo "${PANDOC_SHA256} $package" | sha256sum -c - | |
| sudo dpkg -i "$package" | |
| pandoc --version | head -1 | |
| - name: Run book contract tests | |
| run: | | |
| python3 -m unittest discover -s tests -p 'test_*.py' -v | |
| python3 check_project_rules.py && python3 check_emphasis.py | |
| - name: Set up Chrome | |
| id: setupchrome | |
| uses: browser-actions/setup-chrome@2e1d749697dd1612b833dba4a722266286fbefcd # v2.1.2 | |
| with: | |
| chrome-version: stable | |
| - name: Install CJK fonts and PDF inspection tools | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y fonts-noto-cjk fonts-noto-cjk-extra poppler-utils | |
| - name: Resolve latest mdPress release | |
| run: | | |
| url="$(curl -fsSL --retry 3 -o /dev/null -w '%{url_effective}' https://github.com/yeasy/mdPress/releases/latest)" | |
| version="${url##*/v}" | |
| test -n "$version" || { echo "could not resolve latest mdPress release"; exit 1; } | |
| echo "MDPRESS_VERSION=$version" >> "$GITHUB_ENV" | |
| echo "resolved mdPress $version" | |
| - name: Install mdPress (checksum-verified) | |
| run: | | |
| archive="$RUNNER_TEMP/mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz" | |
| curl -fsSL --retry 3 \ | |
| "https://github.com/yeasy/mdPress/releases/download/v${MDPRESS_VERSION}/mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz" \ | |
| -o "$archive" | |
| expected="$(curl -fsSL --retry 3 "https://github.com/yeasy/mdPress/releases/download/v${MDPRESS_VERSION}/checksums.txt" \ | |
| | awk -v f="mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz" '$2==f {print $1}')" | |
| test -n "$expected" || { echo "no published checksum for mdpress_${MDPRESS_VERSION}_linux_amd64.tar.gz"; exit 1; } | |
| echo "${expected} $archive" | sha256sum -c - | |
| tar xzf "$archive" -C "$RUNNER_TEMP" mdpress | |
| mkdir -p "$RUNNER_TEMP/bin" | |
| install -m 0755 "$RUNNER_TEMP/mdpress" "$RUNNER_TEMP/bin/mdpress" | |
| echo "$RUNNER_TEMP/bin" >> "$GITHUB_PATH" | |
| - name: Install locked Mermaid CLI | |
| run: | | |
| PUPPETEER_SKIP_DOWNLOAD=true npm ci --prefix tools/mermaid --ignore-scripts | |
| echo "$GITHUB_WORKSPACE/tools/mermaid/node_modules/.bin" >> "$GITHUB_PATH" | |
| - name: Build PDF and HTML | |
| run: | | |
| # mdPress PDF generation drives headless Chrome, which intermittently dies with | |
| # "websocket url timeout reached" + dbus errors. Retry the build, not the whole job. | |
| mdpress() { local a; for a in 1 2 3; do command mdpress "$@" && return 0; | |
| echo "::warning::mdpress attempt $a failed; retrying in 10s"; sleep 10; done; return 1; } | |
| mkdir -p dist | |
| title=$(python3 -c 'import json; print(json.load(open("book.json"))["title"])') | |
| mdpress build --format pdf --output dist/blockchain_guide.pdf | |
| python3 tools/render_mermaid.py \ | |
| --book-dir . \ | |
| --svg-out "$RUNNER_TEMP/mermaid-svg" \ | |
| --require-all | |
| python3 tools/build_html_reader.py \ | |
| --book-dir . \ | |
| --title "$title" \ | |
| --svg-dir "$RUNNER_TEMP/mermaid-svg" \ | |
| --out dist/blockchain_guide.html | |
| - name: Verify build artifacts | |
| run: | | |
| title=$(python3 -c 'import json; print(json.load(open("book.json"))["title"])') | |
| python3 tools/verify_release_artifacts.py \ | |
| --title "$title" \ | |
| --pdf dist/blockchain_guide.pdf \ | |
| --html dist/blockchain_guide.html \ | |
| --source-root . \ | |
| --checksums dist/SHA256SUMS | |
| (cd dist && sha256sum -c SHA256SUMS) | |
| - name: Upload verified publications | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: blockchain-guide-publications | |
| path: | | |
| dist/blockchain_guide.pdf | |
| dist/blockchain_guide.html | |
| dist/SHA256SUMS | |
| if-no-files-found: error | |
| chaincode-tests: | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| example: | |
| - example01 | |
| - example02 | |
| - example03 | |
| - example04 | |
| - example05 | |
| - example06 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Go | |
| uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 | |
| with: | |
| go-version-file: 11_app_dev/go.mod | |
| cache-dependency-path: 11_app_dev/go.sum | |
| - name: Test chaincode example | |
| working-directory: 11_app_dev | |
| run: go test "./examples/${{ matrix.example }}" -count=1 |