Skip to content
This repository was archived by the owner on Mar 23, 2021. It is now read-only.

Commit 67c9ed7

Browse files
author
Franck Royer
authored
Merge pull request #3287 from comit-network/release/cnd/0.9.0
2 parents 284913e + 3c6a20a commit 67c9ed7

442 files changed

Lines changed: 36654 additions & 26148 deletions

File tree

Some content is hidden

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

.dependabot/config.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Create release archive
2+
description: Creates a tar archive for a release binary
3+
inputs:
4+
version:
5+
description: 'The version of the binary'
6+
required: true
7+
binary:
8+
description: 'The name of the binary to pack into the archive'
9+
required: true
10+
outputs:
11+
archive:
12+
description: 'The name of the archive'
13+
value: ${{ steps.create-archive-name.outputs.archive }}
14+
runs:
15+
using: "composite"
16+
steps:
17+
- id: create-archive-name
18+
shell: python # Use python to have a prettier name for the archive on Windows.
19+
run: |
20+
import platform
21+
os_info = platform.uname()
22+
23+
archive_name=f'${{ inputs.binary }}_${{ inputs.version }}_{os_info.system}_{os_info.machine}'
24+
25+
print(f'::set-output name=archive::{archive_name}')
26+
27+
- name: Make archive
28+
shell: bash
29+
run: tar -C ./target/release --create --file=${{ steps.create-archive-name.outputs.archive }} ${{ inputs.binary }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Trim front
2+
description: Trims a string by a given prefix
3+
inputs:
4+
string:
5+
description: 'The string to be trimmed'
6+
required: true
7+
prefix:
8+
description: 'The prefix that should be removed from the string'
9+
required: true
10+
outputs:
11+
trimmed:
12+
description: 'The remaining part of the string'
13+
value: ${{ steps.trim-front.outputs.trimmed }}
14+
runs:
15+
using: "composite"
16+
steps:
17+
- id: trim-front
18+
shell: bash
19+
run: |
20+
FULL_STRING="${{ inputs.string }}"
21+
TRIMMED=${FULL_STRING#${{ inputs.prefix }}}
22+
23+
echo "::set-output name=trimmed::$TRIMMED"

.github/dependabot.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: cargo
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "00:00"
8+
timezone: Australia/Brisbane
9+
labels:
10+
- dependencies
11+
allow:
12+
- dependency-type: direct
13+
ignore:
14+
- dependency-name: bytes
15+
versions:
16+
- ">= 0"
17+
- dependency-name: libsqlite3-sys
18+
versions:
19+
- ">= 0"
20+
- package-ecosystem: npm
21+
directory: "/tests"
22+
schedule:
23+
interval: daily
24+
time: "00:00"
25+
timezone: Australia/Brisbane
26+
labels:
27+
- dependencies
28+
allow:
29+
- dependency-type: direct
30+
ignore:
31+
- dependency-name: ethereumjs-tx
32+
versions:
33+
- "> 1.3.7"
34+
- dependency-name: web3
35+
versions:
36+
- "> 1.0.0-beta.55"

.github/workflows/ci.yml

Lines changed: 74 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,31 @@ jobs:
2323
profile: minimal
2424
override: true
2525

26-
- name: Cache cargo binaries, registry and target directory
26+
- name: Install NodeJS 14.x
27+
uses: actions/setup-node@v1
28+
with:
29+
node-version: '14.x'
30+
31+
- name: Cache cargo registry
2732
uses: actions/cache@v2
2833
with:
29-
path: |
30-
~/.cargo/bin
31-
~/.cargo/registry
32-
target
33-
key: ubuntu-rust-${{ steps.toolchain.outputs.rustc-hash }}
34+
path: ~/.cargo/registry
35+
# The registry cache is useful as long as we need the same dependencies as another job, regardless of the Rust version and operating system.
36+
key: cargo-registry-${{ hashFiles('Cargo.lock') }}-v2
37+
38+
- name: Cache cargo binaries
39+
uses: actions/cache@v2
40+
with:
41+
path: ~/.cargo/bin
42+
# The cargo binary cache is useful as long as we use the same Rust version but regardless of our dependencies.
43+
key: ubuntu-latest-cargo-binaries-${{ steps.toolchain.outputs.rustc_hash }}-v2
44+
45+
- name: Cache target directory
46+
uses: actions/cache@v2
47+
with:
48+
path: target
49+
# The target directory is only useful with the same Rust version, dependencies and operating system.
50+
key: ubuntu-latest-target-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('Cargo.lock') }}-clippy-v2
3451

3552
- name: Check formatting
3653
run: make check_format
@@ -45,6 +62,8 @@ jobs:
4562
include:
4663
- os: ubuntu-latest
4764
e2e: true
65+
- os: macos-latest
66+
e2e: true
4867
runs-on: ${{ matrix.os }}
4968
steps:
5069
- name: Checkout sources
@@ -57,14 +76,27 @@ jobs:
5776
profile: minimal
5877
override: true
5978

60-
- name: Cache cargo binaries, registry and target directory
79+
- name: Cache cargo registry
80+
uses: actions/cache@v2
81+
with:
82+
path: ~/.cargo/registry
83+
# The registry cache is useful as long as we need the same dependencies as another job, regardless of the Rust version and operating system.
84+
key: cargo-registry-${{ hashFiles('Cargo.lock') }}-v3
85+
86+
- name: Cache cargo binaries
6187
uses: actions/cache@v2
6288
with:
63-
path: |
64-
~/.cargo/bin
65-
~/.cargo/registry
66-
target
67-
key: ubuntu-rust-${{ steps.toolchain.outputs.rustc-hash }}
89+
path: ~/.cargo/bin
90+
# The cargo binary cache is useful as long as we use the same Rust version and operating system, but regardless of our dependencies.
91+
key: ${{ matrix.os }}-cargo-binaries-${{ steps.toolchain.outputs.rustc_hash }}-v2
92+
93+
- name: Cache target directory
94+
uses: actions/cache@v2
95+
if: matrix.os == 'ubuntu-latest'
96+
with:
97+
path: target
98+
# The target directory is only useful with the same Rust version, dependencies and operating system.
99+
key: ${{ matrix.os }}-target-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('Cargo.lock') }}-build-v3
68100

69101
- name: Build ${{ matrix.os }} binary
70102
run: make build
@@ -77,59 +109,73 @@ jobs:
77109
if: matrix.os == 'ubuntu-latest'
78110
run: make test
79111

112+
# We've ran `cargo build --all-targets` earlier, that is different to from just building the binary.
113+
# Our e2e tests lazily re-build the binaries, that can timeout our tests so build them here in advance.
114+
- name: Build binaries for e2e test
115+
if: matrix.e2e
116+
run: |
117+
cargo build -p cnd
118+
cargo build -p nectar
119+
80120
- name: Upload cnd-${{ matrix.os }} archive that contains the cnd binary
81-
if: matrix.os == 'ubuntu-latest'
121+
if: matrix.e2e
82122
uses: actions/upload-artifact@v1
83123
with:
84124
name: cnd-${{ matrix.os }}
85125
path: target/debug/cnd
86126

87-
## Run e2e tests
88-
- name: Install NodeJS 12.x
127+
- name: Upload nectar-${{ matrix.os }} archive that contains the nectar binary
128+
if: matrix.e2e
129+
uses: actions/upload-artifact@v1
130+
with:
131+
name: nectar-${{ matrix.os }}
132+
path: target/debug/nectar
133+
134+
- name: Install NodeJS 14.x
89135
if: matrix.e2e
90136
uses: actions/setup-node@v1
91137
with:
92-
node-version: '12.x'
138+
node-version: '14.x'
93139

94140
- name: Cache node_modules directory
95141
if: matrix.e2e
96142
uses: actions/cache@v2
97143
with:
98-
path: api_tests/node_modules
99-
key: ${{ matrix.os }}-node-modules-directory-${{ hashFiles('api_tests/package.json') }}
144+
path: tests/node_modules
145+
key: ${{ matrix.os }}-node-14-node-modules-directory-${{ hashFiles('tests/package.json') }}
100146

101147
- name: Run e2e tests
102148
if: matrix.e2e
103149
run: |
104150
export PATH=$HOME/.cargo/bin:$HOME/.local/bin:$PATH
105-
cd api_tests
151+
cd tests
106152
yarn install
107-
yarn ci
153+
yarn test
108154
109155
- name: Upload bitcoind log
110156
if: matrix.e2e && failure()
111157
uses: actions/upload-artifact@v2-preview
112158
with:
113-
name: e2e-logs-bitcoind.log
114-
path: api_tests/log/bitcoind/regtest/debug.log
159+
name: ${{ matrix.os }}-e2e-logs-bitcoind.log
160+
path: tests/log/bitcoind/regtest/debug.log
115161

116162
- name: Upload parity log
117163
if: matrix.e2e && failure()
118164
uses: actions/upload-artifact@v2-preview
119165
with:
120-
name: e2e-logs-parity.log
121-
path: api_tests/log/parity/parity.log
166+
name: ${{ matrix.os }}-e2e-logs-parity.log
167+
path: tests/log/parity/parity.log
122168

123169
- name: Upload lnd logs
124170
if: matrix.e2e && failure()
125171
uses: actions/upload-artifact@v2-preview
126172
with:
127-
name: e2e-logs-lnd
128-
path: api_tests/log/lnd-*/logs/bitcoin/regtest/lnd.log
173+
name: ${{ matrix.os }}-e2e-logs-lnd
174+
path: tests/log/lnd-*/logs/bitcoin/regtest/lnd.log
129175

130176
- name: Upload e2e logs
131177
if: matrix.e2e && failure()
132178
uses: actions/upload-artifact@v2-preview
133179
with:
134-
name: e2e-test-logs
135-
path: api_tests/log/tests/
180+
name: ${{ matrix.os }}-e2e-test-logs
181+
path: tests/log/tests/
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "Create cnd GitHub release"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
types:
8+
- closed
9+
10+
jobs:
11+
create_gh_release:
12+
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/cnd/') # only merged release branches must trigger this
13+
name: Create cnd GitHub release
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout sources to access local actions
17+
uses: actions/checkout@v2
18+
19+
- name: Extract version from branch name
20+
id: extract-version
21+
uses: ./.github/actions/trim-front
22+
with:
23+
string: ${{ github.event.pull_request.head.ref }}
24+
prefix: release/cnd/
25+
26+
- name: Create Release
27+
id: create-release
28+
uses: thomaseizinger/create-release@1.0.0
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.BOTTY_GITHUB_TOKEN }}
31+
with:
32+
target_commitish: ${{ github.event.pull_request.merge_commit_sha }}
33+
tag_name: cnd-${{ steps.extract-version.outputs.trimmed }}
34+
name: cnd-${{ steps.extract-version.outputs.trimmed }}
35+
draft: false
36+
prerelease: false
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "Create nectar GitHub release"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
types:
8+
- closed
9+
10+
jobs:
11+
create_gh_release:
12+
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/nectar/') # only merged release branches must trigger this
13+
name: Create nectar GitHub release
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout sources to access local actions
17+
uses: actions/checkout@v2
18+
19+
- name: Extract version from branch name
20+
id: extract-version
21+
uses: ./.github/actions/trim-front
22+
with:
23+
string: ${{ github.event.pull_request.head.ref }}
24+
prefix: release/nectar/
25+
26+
- name: Create Release
27+
id: create-release
28+
uses: thomaseizinger/create-release@1.0.0
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.BOTTY_GITHUB_TOKEN }}
31+
with:
32+
target_commitish: ${{ github.event.pull_request.merge_commit_sha }}
33+
tag_name: nectar-${{ steps.extract-version.outputs.trimmed }}
34+
name: nectar-${{ steps.extract-version.outputs.trimmed }}
35+
draft: false
36+
prerelease: false

0 commit comments

Comments
 (0)