-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
150 changed files
with
33,536 additions
and
1,497 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
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,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 }} |
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,168 @@ | ||
name: Cross-chain Polygon | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "cross-chain/polygon/**" | ||
- ".github/workflows/cross-chain-polygon.yml" | ||
|
||
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/polygon/**' | ||
- './.github/workflows/cross-chain-polygon.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/polygon | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "14.x" | ||
cache: "yarn" | ||
cache-dependency-path: cross-chain/polygon/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/polygon | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "14.x" | ||
cache: "yarn" | ||
cache-dependency-path: cross-chain/polygon/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/polygon | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "14.x" | ||
cache: "yarn" | ||
cache-dependency-path: cross-chain/polygon/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/polygon | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "14.x" | ||
cache: "yarn" | ||
cache-dependency-path: cross-chain/polygon/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 . |
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
Oops, something went wrong.