Skip to content

Commit

Permalink
Merge branch 'development' into development_chainspecs
Browse files Browse the repository at this point in the history
  • Loading branch information
sameh-farouk committed Apr 14, 2024
2 parents d62c57a + 33046d6 commit abfeddb
Show file tree
Hide file tree
Showing 437 changed files with 79,126 additions and 18,437 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
substrate-node
activation-service
clients/tfchain-client-rs
clients/tfchain-client-js
tools
cli-tool
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

## Describe the bug

Thanks for taking the time to fill out this bug report! Please add a clear and concise description of what the bug is.

## To Reproduce

Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

## Expected

A clear and concise description of what you expected to happen.

## Screenshots

If applicable, add screenshots to help explain your problem.

## Additional context

Add any other context about the problem here.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

## Is your feature request related to a problem? Please describe

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 \[...]

## Describe the solution you'd like

A clear and concise description of what you want to happen.

## Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

## Additional context
Add any other context or screenshots about the feature request here.

21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Question
about: Ask a question about this project
title: ''
labels: ''
assignees: ''

---

## What is your question?

Ex. How I can \[...]

## What have you tried so far?

If applicable, add the approaches that you have already tried.

## Screenshots

If applicable, add screenshots to help explain your question.

25 changes: 25 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context, including:

- What does this PR do?
- Why are these changes needed?
- How were these changes implemented and what do they affect?

## Related Issues:

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.

- Fixes # (issue number, if applicable)

- Closes # (issue number, if applicable)

## Checklist:

Please delete options that are not relevant.

- [ ] My change requires a change to the documentation and I have updated it accordingly
- [ ] My change requires storage migration and I have included and tested it following fork off and try_runtime instructions.
- [ ] I have added tests to cover my changes.
- [ ] I followed the **[Release](https://github.com/threefoldtech/tfchain/blob/development/docs/production/releases.md)** document.
- [ ] My commits follow this [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) guide.
Original file line number Diff line number Diff line change
@@ -1,47 +1,54 @@
name: Build and Test
on:
on:
push:
branches:
- development
pull_request:
jobs:
build-and-test:
runs-on: [self-hosted, poc]
runs-on: [self-hosted, tfchainrunner01]
container:
image: threefolddev/tfchain:2
image: threefolddev/tfchain:4
env:
DEBIAN_FRONTEND: noninteractive
PATH: /root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin
RUSTUP_HOME: /root/.rustup
CARGO_HOME: /root/.cargo

steps:
- uses: actions/checkout@v3

- name: Chown user
run: |
chown -R $USER:$USER $GITHUB_WORKSPACE
- name: Cache build
uses: actions/cache@v3
timeout-minutes: 6
continue-on-error: true
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
/root/.cargo/bin/
/root/.cargo/registry/index/
/root/.cargo/registry/cache/
/root/.cargo/git/db/
substrate-node/target/
key: ${{ runner.os }}-tfchain-build-cache-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-tfchain-build-cache

- name: Build
run: |
cd substrate-node
$HOME/.cargo/bin/rustup target add wasm32-unknown-unknown --toolchain nightly-2022-05-11
$HOME/.cargo/bin/cargo +nightly-2022-05-11 build --release
cargo clean
cargo build --release
- name: Unit tests
run: |
cd substrate-node
$HOME/.cargo/bin/cargo +nightly-2022-05-11 test --no-fail-fast
cd pallets
$HOME/.cargo/bin/cargo +nightly-2022-05-11 test --no-fail-fast
cargo test --no-fail-fast --features runtime-benchmarks
- name: Integration tests
if: "!contains(github.event.head_commit.message, '[skip integr]')"
run: |
python3.10 -m pip install robotframework==5.0.1 cryptography==3.4.8 substrate-interface==1.4.0
cd substrate-node/tests
Expand All @@ -52,4 +59,3 @@ jobs:
with:
name: integration test output
path: substrate-node/tests/_output_tests/

47 changes: 47 additions & 0 deletions .github/workflows/020_lint_and_test_go_client.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Lint Go client

on:
push:
paths:
- clients/tfchain-client-go/**
workflow_dispatch:

jobs:
lint:
name: lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
submodules: "true"
sparse-checkout: clients/tfchain-client-go

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.20"
cache: false
# cache-dependency-path: clients/tfchain-client-go/go.sum
id: go

- name: golangci-lint
uses: golangci/golangci-lint-action@v3.7.0
with:
args: --timeout 3m --verbose
working-directory: clients/tfchain-client-go

- name: staticcheck
uses: dominikh/staticcheck-action@v1.3.0
with:
version: "2022.1.3"
working-directory: clients/tfchain-client-go
env:
GO111MODULE: on

- name: gofmt
uses: Jerome1337/gofmt-action@v1.0.5
with:
gofmt-path: './clients/tfchain-client-go'
gofmt-flags: "-l -d"
102 changes: 102 additions & 0 deletions .github/workflows/030_create_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Create release

on:
push:
tags:
- '*'

jobs:
srtool:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Cache target dir
uses: actions/cache@v3
with:
path: '${{ github.workspace }}/substrate-node/runtime/target'
key: srtool-target-tfchain-${{ github.sha }}
restore-keys: |
srtool-target-tfchain-
srtool-target-
- name: Srtool build
id: srtool_build
uses: chevdor/srtool-actions@v0.7.0
with:
workdir: '${{ github.workspace }}/substrate-node'
package: tfchain-runtime
runtime_dir: runtime

- name: Summary
run: |
echo '${{ steps.srtool_build.outputs.json }}' | jq . > tfchain-srtool-digest.json
cat tfchain-srtool-digest.json
echo "Runtime location: ${{ steps.srtool_build.outputs.wasm }}"
- name: Upload tfchain srtool json
uses: actions/upload-artifact@v3
with:
name: tfchain-srtool-digest-json
path: tfchain-srtool-digest.json

- name: Upload runtime
uses: actions/upload-artifact@v3
with:
name: tfchain-runtime
path: substrate-node/${{ steps.srtool_build.outputs.wasm_compressed }}

release:
needs: srtool
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # Work around for https://github.com/heinrichreimer/action-github-changelog-generator/issues/21

- name: Download artifacts
id: download
uses: actions/download-artifact@v3
with:
name: tfchain-runtime
path: tfchain-runtime

- name: Generate changelog
id: changelog
uses: heinrichreimer/github-changelog-generator-action@v2.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
headerLabel: "# 📑 Changelog"
breakingLabel: '### 💥 Breaking'
enhancementLabel: '### 🚀 Enhancements'
bugsLabel: '### 🐛 Bug fixes'
securityLabel: '### 🛡️ Security'
issuesLabel: '### 📁 Other issues'
prLabel: '### 📁 Other pull requests'
addSections: '{"documentation":{"prefix":"### 📖 Documentation","labels":["documentation"]},"tests":{"prefix":"### ✅ Testing","labels":["tests"]}}'
onlyLastTag: true
issues: false
issuesWoLabels: false
pullRequests: true
prWoLabels: true
author: true
unreleased: true
compareLink: true
stripGeneratorNotice: true
verbose: true

- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_KEY }}
with:
tag_name: ${{ github.ref }}
name: Release ${{ github.ref_name }}
draft: false
fail_on_unmatched_files: true
prerelease: ${{ contains(github.ref, 'rc') }}
body: ${{ steps.changelog.outputs.changelog }}
files: tfchain-runtime/*
40 changes: 40 additions & 0 deletions .github/workflows/040_publish_activation_service_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish activation service image

on:
workflow_dispatch:
release:
types: [published]

jobs:
build-and-push:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write

steps:
- name: Checkout the repo
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/threefoldtech/tfchain_activation_service
tags: |
type=semver,pattern={{version}}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: ./activation-service
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Loading

0 comments on commit abfeddb

Please sign in to comment.