Skip to content

Commit abfeddb

Browse files
committed
Merge branch 'development' into development_chainspecs
2 parents d62c57a + 33046d6 commit abfeddb

File tree

437 files changed

+79126
-18437
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

437 files changed

+79126
-18437
lines changed

.dockerignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
substrate-node
2+
activation-service
3+
clients/tfchain-client-rs
4+
clients/tfchain-client-js
5+
tools
6+
cli-tool

.github/ISSUE_TEMPLATE/bug_report.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
## Describe the bug
11+
12+
Thanks for taking the time to fill out this bug report! Please add a clear and concise description of what the bug is.
13+
14+
## To Reproduce
15+
16+
Steps to reproduce the behavior:
17+
1. Go to '...'
18+
2. Click on '....'
19+
3. Scroll down to '....'
20+
4. See error
21+
22+
## Expected
23+
24+
A clear and concise description of what you expected to happen.
25+
26+
## Screenshots
27+
28+
If applicable, add screenshots to help explain your problem.
29+
30+
## Additional context
31+
32+
Add any other context about the problem here.
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
## Is your feature request related to a problem? Please describe
11+
12+
Thanks for taking the time to fill out this feature request. Please add a clear and concise description of what the problem is. Ex. I'm always frustrated when \[...]
13+
14+
## Describe the solution you'd like
15+
16+
A clear and concise description of what you want to happen.
17+
18+
## Describe alternatives you've considered
19+
A clear and concise description of any alternative solutions or features you've considered.
20+
21+
## Additional context
22+
Add any other context or screenshots about the feature request here.
23+

.github/ISSUE_TEMPLATE/question.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Question
3+
about: Ask a question about this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
## What is your question?
11+
12+
Ex. How I can \[...]
13+
14+
## What have you tried so far?
15+
16+
If applicable, add the approaches that you have already tried.
17+
18+
## Screenshots
19+
20+
If applicable, add screenshots to help explain your question.
21+

.github/pull_request_template.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## Description
2+
3+
Please include a summary of the changes and the related issue. Please also include relevant motivation and context, including:
4+
5+
- What does this PR do?
6+
- Why are these changes needed?
7+
- How were these changes implemented and what do they affect?
8+
9+
## Related Issues:
10+
11+
Use [Github semantic linking](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) to address any open issues this PR relates to or closes.
12+
13+
- Fixes # (issue number, if applicable)
14+
15+
- Closes # (issue number, if applicable)
16+
17+
## Checklist:
18+
19+
Please delete options that are not relevant.
20+
21+
- [ ] My change requires a change to the documentation and I have updated it accordingly
22+
- [ ] My change requires storage migration and I have included and tested it following fork off and try_runtime instructions.
23+
- [ ] I have added tests to cover my changes.
24+
- [ ] I followed the **[Release](https://github.com/threefoldtech/tfchain/blob/development/docs/production/releases.md)** document.
25+
- [ ] My commits follow this [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) guide.

.github/workflows/build_test.yaml .github/workflows/010_build_and_test.yaml

+19-13
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,54 @@
11
name: Build and Test
2-
on:
2+
on:
33
push:
44
branches:
55
- development
66
pull_request:
77
jobs:
88
build-and-test:
9-
runs-on: [self-hosted, poc]
9+
runs-on: [self-hosted, tfchainrunner01]
1010
container:
11-
image: threefolddev/tfchain:2
11+
image: threefolddev/tfchain:4
1212
env:
1313
DEBIAN_FRONTEND: noninteractive
14+
PATH: /root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin
15+
RUSTUP_HOME: /root/.rustup
16+
CARGO_HOME: /root/.cargo
17+
1418
steps:
1519
- uses: actions/checkout@v3
1620

21+
- name: Chown user
22+
run: |
23+
chown -R $USER:$USER $GITHUB_WORKSPACE
24+
1725
- name: Cache build
1826
uses: actions/cache@v3
1927
timeout-minutes: 6
2028
continue-on-error: true
2129
with:
2230
path: |
23-
~/.cargo/bin/
24-
~/.cargo/registry/index/
25-
~/.cargo/registry/cache/
26-
~/.cargo/git/db/
31+
/root/.cargo/bin/
32+
/root/.cargo/registry/index/
33+
/root/.cargo/registry/cache/
34+
/root/.cargo/git/db/
2735
substrate-node/target/
2836
key: ${{ runner.os }}-tfchain-build-cache-${{ hashFiles('**/Cargo.lock') }}
2937
restore-keys: ${{ runner.os }}-tfchain-build-cache
3038

3139
- name: Build
3240
run: |
3341
cd substrate-node
34-
$HOME/.cargo/bin/rustup target add wasm32-unknown-unknown --toolchain nightly-2022-05-11
35-
$HOME/.cargo/bin/cargo +nightly-2022-05-11 build --release
42+
cargo clean
43+
cargo build --release
3644
3745
- name: Unit tests
3846
run: |
3947
cd substrate-node
40-
$HOME/.cargo/bin/cargo +nightly-2022-05-11 test --no-fail-fast
41-
cd pallets
42-
$HOME/.cargo/bin/cargo +nightly-2022-05-11 test --no-fail-fast
48+
cargo test --no-fail-fast --features runtime-benchmarks
4349
4450
- name: Integration tests
51+
if: "!contains(github.event.head_commit.message, '[skip integr]')"
4552
run: |
4653
python3.10 -m pip install robotframework==5.0.1 cryptography==3.4.8 substrate-interface==1.4.0
4754
cd substrate-node/tests
@@ -52,4 +59,3 @@ jobs:
5259
with:
5360
name: integration test output
5461
path: substrate-node/tests/_output_tests/
55-
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Lint Go client
2+
3+
on:
4+
push:
5+
paths:
6+
- clients/tfchain-client-go/**
7+
workflow_dispatch:
8+
9+
jobs:
10+
lint:
11+
name: lint
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 5
14+
steps:
15+
- name: Check out code into the Go module directory
16+
uses: actions/checkout@v4
17+
with:
18+
submodules: "true"
19+
sparse-checkout: clients/tfchain-client-go
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: "1.20"
25+
cache: false
26+
# cache-dependency-path: clients/tfchain-client-go/go.sum
27+
id: go
28+
29+
- name: golangci-lint
30+
uses: golangci/[email protected]
31+
with:
32+
args: --timeout 3m --verbose
33+
working-directory: clients/tfchain-client-go
34+
35+
- name: staticcheck
36+
uses: dominikh/[email protected]
37+
with:
38+
version: "2022.1.3"
39+
working-directory: clients/tfchain-client-go
40+
env:
41+
GO111MODULE: on
42+
43+
- name: gofmt
44+
uses: Jerome1337/[email protected]
45+
with:
46+
gofmt-path: './clients/tfchain-client-go'
47+
gofmt-flags: "-l -d"
+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Create release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
srtool:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Cache target dir
16+
uses: actions/cache@v3
17+
with:
18+
path: '${{ github.workspace }}/substrate-node/runtime/target'
19+
key: srtool-target-tfchain-${{ github.sha }}
20+
restore-keys: |
21+
srtool-target-tfchain-
22+
srtool-target-
23+
24+
- name: Srtool build
25+
id: srtool_build
26+
uses: chevdor/[email protected]
27+
with:
28+
workdir: '${{ github.workspace }}/substrate-node'
29+
package: tfchain-runtime
30+
runtime_dir: runtime
31+
32+
- name: Summary
33+
run: |
34+
echo '${{ steps.srtool_build.outputs.json }}' | jq . > tfchain-srtool-digest.json
35+
cat tfchain-srtool-digest.json
36+
echo "Runtime location: ${{ steps.srtool_build.outputs.wasm }}"
37+
38+
- name: Upload tfchain srtool json
39+
uses: actions/upload-artifact@v3
40+
with:
41+
name: tfchain-srtool-digest-json
42+
path: tfchain-srtool-digest.json
43+
44+
- name: Upload runtime
45+
uses: actions/upload-artifact@v3
46+
with:
47+
name: tfchain-runtime
48+
path: substrate-node/${{ steps.srtool_build.outputs.wasm_compressed }}
49+
50+
release:
51+
needs: srtool
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@v3
56+
with:
57+
fetch-depth: 0 # Work around for https://github.com/heinrichreimer/action-github-changelog-generator/issues/21
58+
59+
- name: Download artifacts
60+
id: download
61+
uses: actions/download-artifact@v3
62+
with:
63+
name: tfchain-runtime
64+
path: tfchain-runtime
65+
66+
- name: Generate changelog
67+
id: changelog
68+
uses: heinrichreimer/[email protected]
69+
with:
70+
token: ${{ secrets.GITHUB_TOKEN }}
71+
headerLabel: "# 📑 Changelog"
72+
breakingLabel: '### 💥 Breaking'
73+
enhancementLabel: '### 🚀 Enhancements'
74+
bugsLabel: '### 🐛 Bug fixes'
75+
securityLabel: '### 🛡️ Security'
76+
issuesLabel: '### 📁 Other issues'
77+
prLabel: '### 📁 Other pull requests'
78+
addSections: '{"documentation":{"prefix":"### 📖 Documentation","labels":["documentation"]},"tests":{"prefix":"### ✅ Testing","labels":["tests"]}}'
79+
onlyLastTag: true
80+
issues: false
81+
issuesWoLabels: false
82+
pullRequests: true
83+
prWoLabels: true
84+
author: true
85+
unreleased: true
86+
compareLink: true
87+
stripGeneratorNotice: true
88+
verbose: true
89+
90+
- name: Create Release
91+
id: create_release
92+
uses: softprops/action-gh-release@v1
93+
env:
94+
GITHUB_TOKEN: ${{ secrets.RELEASE_KEY }}
95+
with:
96+
tag_name: ${{ github.ref }}
97+
name: Release ${{ github.ref_name }}
98+
draft: false
99+
fail_on_unmatched_files: true
100+
prerelease: ${{ contains(github.ref, 'rc') }}
101+
body: ${{ steps.changelog.outputs.changelog }}
102+
files: tfchain-runtime/*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish activation service image
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-22.04
11+
permissions:
12+
contents: read
13+
packages: write
14+
15+
steps:
16+
- name: Checkout the repo
17+
uses: actions/checkout@v3
18+
19+
- name: Log in to the Container registry
20+
uses: docker/[email protected]
21+
with:
22+
registry: ghcr.io
23+
username: ${{ github.actor }}
24+
password: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Extract metadata for Docker
27+
id: meta
28+
uses: docker/metadata-action@v4
29+
with:
30+
images: ghcr.io/threefoldtech/tfchain_activation_service
31+
tags: |
32+
type=semver,pattern={{version}}
33+
34+
- name: Build and push Docker image
35+
uses: docker/build-push-action@v4
36+
with:
37+
context: ./activation-service
38+
push: true
39+
tags: ${{ steps.meta.outputs.tags }}
40+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)