-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'research/docs' of https://github.com/Analog-Labs/timechain
- Loading branch information
Showing
77 changed files
with
10,673 additions
and
3,992 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Compile chronicle | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'contracts/**' | ||
- 'docker/**' | ||
- 'docs/**' | ||
- 'node/**' | ||
- 'infra/**' | ||
- 'js/**' | ||
- 'scripts/**' | ||
- 'tester/**' | ||
- 'utils/**' | ||
- '**/*.md' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-chronicle: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
profile: | ||
- production | ||
- testnet | ||
steps: | ||
- name: Install dependencies | ||
run: sudo apt-get update && sudo apt-get install -y musl-tools protobuf-compiler | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Install rust toolchain | ||
run : rustup show | ||
- name: Setup and cache sccache | ||
uses: visvirial/[email protected] | ||
with: | ||
cache-key: sccache-chronicle-${{ matrix.profile }} | ||
- name: Cache cargo registry and index | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
key: cargo-cache-chronicle-${{ hashFiles('Cargo.lock') }} | ||
restore-keys: cargo-cache-chronicle- | ||
- name: Cache cargo build output | ||
uses: actions/cache@v4 | ||
with: | ||
path: target | ||
key: cargo-build-chronicle-${{ matrix.profile }}-${{ hashFiles('Cargo.lock') }} | ||
restore-keys: cargo-build-chronicle-${{ matrix.profile }}- | ||
- name: Build chronicle | ||
run: cargo build --package chronicle --profile ${{ matrix.profile }} | ||
- name: Upload chronicle | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: chronicle.${{ matrix.profile }} | ||
if-no-files-found: error | ||
path: target/${{ matrix.profile }}/chronicle |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Generate docs | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'docker/**' | ||
- 'infra/**' | ||
- 'js/**' | ||
- 'scripts/**' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install dependencies | ||
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
- name: Install rust toolchain | ||
run : rustup show | ||
- name: Build docs | ||
run: cargo doc --no-deps --document-private-items --workspace | ||
- name: Upload tester | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: docs | ||
if-no-files-found: error | ||
path: target/doc |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Compile node | ||
|
||
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-node: | ||
runs-on: [ self-hosted-timechain ] | ||
needs: [ setup ] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- profile: production | ||
features: default | ||
- profile: testnet | ||
features: default | ||
- profile: testnet | ||
features: development | ||
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-timenode-${{ matrix.profile }}-${{ hashFiles('Cargo.lock') }} | ||
restore-keys: cargo-build-timenode-${{ matrix.profile }}- | ||
- name: Build timechain node | ||
env: | ||
SKIP_WASM_BUILD: true | ||
run: cargo build --package timechain-node --profile ${{ matrix.profile }} --features ${{ matrix.features }} | ||
- name: Upload timechain node | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: timenode.${{ matrix.profile }}.${{ matrix.features }} | ||
if-no-files-found: error | ||
path: target/${{ matrix.profile }}/timechain-node |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,122 @@ | ||
name: Build runtime artifacts | ||
name: Compile runtimes | ||
|
||
on: | ||
push: | ||
branches: | ||
- "ci/runtime/**" | ||
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: | ||
set-tags: | ||
name: Get & set tags | ||
runs-on: ubuntu-latest | ||
outputs: | ||
commit_hash: ${{ steps.get-sha.outputs.sha }} | ||
commit_hash8: ${{ steps.get-sha.outputs.sha8 }} | ||
setup: | ||
runs-on: [ self-hosted-timechain ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Get SHA | ||
id: get-sha | ||
run: | | ||
sha=$(git log -1 --format='%H') | ||
echo "sha=$sha" >> $GITHUB_OUTPUT | ||
echo "sha8=$(git log -1 --format='%H' | cut -c1-8)" >> $GITHUB_OUTPUT | ||
echo "SHA commit:" $sha | ||
- 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: | ||
name: Build runtimes | ||
needs: ["set-tags"] | ||
runs-on: ubuntu-latest | ||
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: Fetch latest code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build timechain runtime | ||
id: srtool_build | ||
uses: chevdor/[email protected] | ||
with: | ||
image: analoglabs/srtool | ||
tag: 1.75.0 | ||
chain: timechain | ||
runtime_dir: "runtime" | ||
- 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 | ||
|
||
- name: Srtool summary | ||
run: | | ||
echo '${{ steps.srtool_build.outputs.json }}' | jq . > timechain-srtool-digest.json | ||
cat timechain-srtool-digest.json | ||
echo "Runtime location: ${{ steps.srtool_build.outputs.wasm_compressed }}" | ||
- name: Upload timechain runtime artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: timechain-runtime | ||
path: | | ||
${{ steps.srtool_build.outputs.wasm_compressed }} | ||
timechain-srtool-digest.json | ||
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 |
Oops, something went wrong.