Skip to content

Commit

Permalink
Merge branch 'main' into dapp-development
Browse files Browse the repository at this point in the history
  • Loading branch information
r-czajkowski committed Aug 3, 2023
2 parents 65a2cfa + a81fd81 commit a12ca03
Show file tree
Hide file tree
Showing 418 changed files with 121,676 additions and 4,872 deletions.
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ e032bba7ce52a877a77573fb5a14944623c77d02
7ad277ff8369b201515ba22872c1251ec93a6b81
5c7e2e3620ec06fb9a7c358c541d491da977ec08
3d8c4861ac467f0390733916775a9ccfafe752e3
921349ff07db0effe9bc658afab6961ff262f35f

# s/btc/BTC
da039720b6eb36e5f7102e83a3e2bb95a09b5772
89 changes: 89 additions & 0 deletions .github/workflows/contracts-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Solidity docs

on:
pull_request:
push:
branches:
- releases/mainnet/solidity/**
release:
types:
- "published"
workflow_dispatch:

jobs:
docs-detect-changes:
runs-on: ubuntu-latest
outputs:
path-filter: ${{ steps.filter.outputs.path-filter }}
steps:
- uses: actions/checkout@v3
if: github.event_name == 'pull_request'
- uses: dorny/paths-filter@v2
if: github.event_name == 'pull_request'
id: filter
with:
filters: |
path-filter:
- './solidity/contracts/**'
- './.github/workflows/contracts-docs.yml'
# This job will be triggered for PRs which modify contracts. It will generate
# the archive with contracts documentation in Markdown and attatch it to the
# workflow run results. Link to the archive will be posted in a PR comment.
# The job will also be run after manual triggering and after pushes to the
# `releases/mainnet/solidity/**` branches.
contracts-docs-publish-preview:
name: Publish preview of contracts documentation
needs: docs-detect-changes
if: |
needs.docs-detect-changes.outputs.path-filter == 'true'
|| github.event_name == 'push'
|| github.event_name == 'workflow_dispatch'
uses: keep-network/ci/.github/workflows/reusable-solidity-docs.yml@main
with:
projectDir: /solidity
# We need to remove unnecessary `//` comment used in the `@dev`
# section of `BitcoinTx` documentation, which was causing problem with
# rendering of the `.md` file. We do that by executing
# `sed -i ':a;N;$!ba;s_///\n//\n_///\n_g'` on the problematic file. The
# command substitutes `///` + newline + `//` + newline with just `///` +
# newline and does this in a loop.
preProcessingCommand: sed -i ':a;N;$!ba;s_///\n//\n_///\n_g' ./contracts/bridge/BitcoinTx.sol
publish: false
addTOC: false
commentPR: true
exportAsGHArtifacts: true

# This job will be triggered for releases which name starts with
# `refs/tags/solidity/`. It will generate contracts documentation in
# Markdown and sync it with a specific path of
# `threshold-network/threshold` repository. If changes will be detected,
# a PR updating the docs will be created in the destination repository. The
# commit pushing the changes will be verified using GPG key.
contracts-docs-publish:
name: Publish contracts documentation
needs: docs-detect-changes
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/solidity/')
uses: keep-network/ci/.github/workflows/reusable-solidity-docs.yml@main
with:
projectDir: /solidity
# We need to remove unnecessary `//` comment used in the `@dev`
# section of `BitcoinTx` documentation, which was causing problem with
# rendering of the `.md` file. We do that by executing
# `sed -i ':a;N;$!ba;s_///\n//\n_///\n_g'` on the problematic file. The
# command substitutes `///` + newline + `//` + newline with just `///` +
# newline and does this in a loop.
preProcessingCommand: sed -i ':a;N;$!ba;s_///\n//\n_///\n_g' ./contracts/bridge/BitcoinTx.sol
publish: true
addTOC: false
verifyCommits: true
destinationRepo: threshold-network/threshold
destinationFolder: ./docs/app-development/tbtc-v2/tbtc-v2-api
destinationBaseBranch: main
userEmail: 38324465+thesis-valkyrie@users.noreply.github.com
userName: Valkyrie
rsyncDelete: true
secrets:
githubToken: ${{ secrets.THRESHOLD_DOCS_GITHUB_TOKEN }}
gpgPrivateKey: ${{ secrets.THRESHOLD_DOCS_GPG_PRIVATE_KEY_BASE64 }}
gpgPassphrase: ${{ secrets.THRESHOLD_DOCS_GPG_PASSPHRASE }}
169 changes: 169 additions & 0 deletions .github/workflows/cross-chain-arbitrum.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
name: Cross-chain Arbitrum

on:
schedule:
- cron: "0 0 * * *"
push:
branches:
- main
paths:
- "cross-chain/arbitrum/**"
- ".github/workflows/cross-chain-arbitrum.yml"
pull_request:

jobs:
contracts-detect-changes:
runs-on: ubuntu-latest
outputs:
path-filter: ${{ steps.filter.outputs.path-filter }}
steps:
- uses: actions/checkout@v3
if: github.event_name == 'pull_request'

- uses: dorny/paths-filter@v2
if: github.event_name == 'pull_request'
id: filter
with:
filters: |
path-filter:
- './cross-chain/arbitrum/**'
- './.github/workflows/cross-chain-arbitrum.yml'
contracts-build-and-test:
needs: contracts-detect-changes
if: |
github.event_name != 'pull_request'
|| needs.contracts-detect-changes.outputs.path-filter == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cross-chain/arbitrum
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: "14.x"
cache: "yarn"
cache-dependency-path: cross-chain/arbitrum/yarn.lock

# A workaround for transitive dependencies that use the obsolete git://
# prefix instead of the recommended https://
- name: Configure git to not use unauthenticated protocol
run: git config --global url."https://".insteadOf git://

- name: Install dependencies
run: yarn install

- name: Build contracts
run: yarn build

- name: Run tests
run: yarn test

contracts-deployment-dry-run:
needs: contracts-detect-changes
if: |
github.event_name != 'pull_request'
|| needs.contracts-detect-changes.outputs.path-filter == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cross-chain/arbitrum
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: "14.x"
cache: "yarn"
cache-dependency-path: cross-chain/arbitrum/yarn.lock

# A workaround for transitive dependencies that use the obsolete git://
# prefix instead of the recommended https://
- name: Configure git to not use unauthenticated protocol
run: git config --global url."https://".insteadOf git://

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Deploy contracts
run: yarn deploy

contracts-format:
needs: contracts-detect-changes
if: |
github.event_name == 'push'
|| needs.contracts-detect-changes.outputs.path-filter == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cross-chain/arbitrum
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: "14.x"
cache: "yarn"
cache-dependency-path: cross-chain/arbitrum/yarn.lock

# A workaround for transitive dependencies that use the obsolete git://
# prefix instead of the recommended https://
- name: Configure git to not use unauthenticated protocol
run: git config --global url."https://".insteadOf git://

- name: Install dependencies
run: yarn install

- name: Build
run: yarn build

- name: Check formatting
run: yarn format

contracts-slither:
needs: contracts-detect-changes
if: |
github.event_name == 'push'
|| needs.contracts-detect-changes.outputs.path-filter == 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cross-chain/arbitrum
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: "14.x"
cache: "yarn"
cache-dependency-path: cross-chain/arbitrum/yarn.lock

- uses: actions/setup-python@v4
with:
python-version: 3.10.8

- name: Install Solidity
env:
SOLC_VERSION: 0.8.17 # according to solidity.version in hardhat.config.ts
run: |
pip3 install solc-select
solc-select install $SOLC_VERSION
solc-select use $SOLC_VERSION
- name: Install Slither
env:
SLITHER_VERSION: 0.8.3
run: pip3 install slither-analyzer==$SLITHER_VERSION

# A workaround for transitive dependencies that use the obsolete git://
# prefix instead of the recommended https://
- name: Configure git to not use unauthenticated protocol
run: git config --global url."https://".insteadOf git://

- name: Install dependencies
run: yarn install

- name: Run Slither
run: slither --hardhat-artifacts-directory build .
Loading

0 comments on commit a12ca03

Please sign in to comment.