Skip to content

docs: intial implementation based on rustdoc and mermaid #50

docs: intial implementation based on rustdoc and mermaid

docs: intial implementation based on rustdoc and mermaid #50

Workflow file for this run

name: Compile runtimes
on:
pull_request:
paths-ignore:
- 'chronicle/**'
- 'contracts/**'
- 'docker/**'
- 'docs/**'
- 'infra/**'
- 'js/**'
- 'lib/**'
- 'scripts/**'
- 'tc-subxt/**'
- 'tester/**'
- 'tss/**'
- 'utils/**'
- '**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
setup:
runs-on: [ self-hosted-timechain ]
steps:
- name: Install rust toolchain
run : rustup show
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: recursive
- name: Cache cargo registry and index
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-cache-timechain-${{ hashFiles('Cargo.lock') }}
restore-keys: cargo-cache-timechain-
build-runtime:
runs-on: [ self-hosted-timechain ]
needs: [ setup ]
strategy:
fail-fast: false
matrix:
include:
- package: timechain-runtime
features: default
crate: timechain_runtime
- package: timechain-runtime
features: development
crate: timechain_runtime
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: recursive
- name: Cache cargo build output
uses: actions/cache@v4
with:
path: target
key: cargo-build-${{ matrix.package }}-${{ matrix.features }}-${{ hashFiles('Cargo.lock') }}
restore-keys: cargo-build-${{ matrix.package }}-${{ matrix.features }}-
- name: Build timechain runtime
run: cargo build --package ${{ matrix.package }} --profile release --features ${{ matrix.features }}
- name: Upload timechain runtime
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.package }}.${{ matrix.features }}.wasm
if-no-files-found: error
path: target/release/wbuild/${{ matrix.package }}/${{ matrix.crate }}.compact.compressed.wasm
- name: Upload timechain metadata
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.package }}.${{ matrix.features }}.scale
if-no-files-found: error
path: target/release/wbuild/${{ matrix.package }}/${{ matrix.crate }}.metadata.scale
update-metadata:
runs-on: [ self-hosted-timechain ]
needs: [ build-runtime ]
if: ${{ always() }}
continue-on-error: true
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Download and update Testnet Metadata
id: download-testnet-default-metadata
uses: actions/download-artifact@v4
continue-on-error: true
with:
name: timechain-runtime.default.scale
- name: Download and Testnet Metadata
if: steps.download-testnet-default-metadata.outcome == 'success'
run: mv timechain_runtime.metadata.scale config/subxt/testnet.default.scale
- name: Download Development Metadata
id: download-testnet-development-metadata
uses: actions/download-artifact@v4
continue-on-error: true
with:
name: timechain-runtime.development.scale
- name: Update Development Metadata
if: steps.download-testnet-development-metadata.outcome == 'success'
run: mv timechain_runtime.metadata.scale config/subxt/testnet.development.scale
- name: Commit any changes to the metadata
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if ! git diff --quiet; then
git config user.email "[email protected]"
git config user.name "Metadata Update Bot"
git commit -am "tc-subxt: Automated metadata update"
git push
fi