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

Commit

Permalink
Merge pull request #3287 from comit-network/release/cnd/0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Franck Royer authored Oct 13, 2020
2 parents 284913e + 3c6a20a commit 67c9ed7
Show file tree
Hide file tree
Showing 442 changed files with 36,654 additions and 26,148 deletions.
27 changes: 0 additions & 27 deletions .dependabot/config.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/actions/create-release-archive/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Create release archive
description: Creates a tar archive for a release binary
inputs:
version:
description: 'The version of the binary'
required: true
binary:
description: 'The name of the binary to pack into the archive'
required: true
outputs:
archive:
description: 'The name of the archive'
value: ${{ steps.create-archive-name.outputs.archive }}
runs:
using: "composite"
steps:
- id: create-archive-name
shell: python # Use python to have a prettier name for the archive on Windows.
run: |
import platform
os_info = platform.uname()
archive_name=f'${{ inputs.binary }}_${{ inputs.version }}_{os_info.system}_{os_info.machine}'
print(f'::set-output name=archive::{archive_name}')
- name: Make archive
shell: bash
run: tar -C ./target/release --create --file=${{ steps.create-archive-name.outputs.archive }} ${{ inputs.binary }}
23 changes: 23 additions & 0 deletions .github/actions/trim-front/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Trim front
description: Trims a string by a given prefix
inputs:
string:
description: 'The string to be trimmed'
required: true
prefix:
description: 'The prefix that should be removed from the string'
required: true
outputs:
trimmed:
description: 'The remaining part of the string'
value: ${{ steps.trim-front.outputs.trimmed }}
runs:
using: "composite"
steps:
- id: trim-front
shell: bash
run: |
FULL_STRING="${{ inputs.string }}"
TRIMMED=${FULL_STRING#${{ inputs.prefix }}}
echo "::set-output name=trimmed::$TRIMMED"
36 changes: 36 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: 2
updates:
- package-ecosystem: cargo
directory: "/"
schedule:
interval: daily
time: "00:00"
timezone: Australia/Brisbane
labels:
- dependencies
allow:
- dependency-type: direct
ignore:
- dependency-name: bytes
versions:
- ">= 0"
- dependency-name: libsqlite3-sys
versions:
- ">= 0"
- package-ecosystem: npm
directory: "/tests"
schedule:
interval: daily
time: "00:00"
timezone: Australia/Brisbane
labels:
- dependencies
allow:
- dependency-type: direct
ignore:
- dependency-name: ethereumjs-tx
versions:
- "> 1.3.7"
- dependency-name: web3
versions:
- "> 1.0.0-beta.55"
102 changes: 74 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,31 @@ jobs:
profile: minimal
override: true

- name: Cache cargo binaries, registry and target directory
- name: Install NodeJS 14.x
uses: actions/setup-node@v1
with:
node-version: '14.x'

- name: Cache cargo registry
uses: actions/cache@v2
with:
path: |
~/.cargo/bin
~/.cargo/registry
target
key: ubuntu-rust-${{ steps.toolchain.outputs.rustc-hash }}
path: ~/.cargo/registry
# The registry cache is useful as long as we need the same dependencies as another job, regardless of the Rust version and operating system.
key: cargo-registry-${{ hashFiles('Cargo.lock') }}-v2

- name: Cache cargo binaries
uses: actions/cache@v2
with:
path: ~/.cargo/bin
# The cargo binary cache is useful as long as we use the same Rust version but regardless of our dependencies.
key: ubuntu-latest-cargo-binaries-${{ steps.toolchain.outputs.rustc_hash }}-v2

- name: Cache target directory
uses: actions/cache@v2
with:
path: target
# The target directory is only useful with the same Rust version, dependencies and operating system.
key: ubuntu-latest-target-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('Cargo.lock') }}-clippy-v2

- name: Check formatting
run: make check_format
Expand All @@ -45,6 +62,8 @@ jobs:
include:
- os: ubuntu-latest
e2e: true
- os: macos-latest
e2e: true
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
Expand All @@ -57,14 +76,27 @@ jobs:
profile: minimal
override: true

- name: Cache cargo binaries, registry and target directory
- name: Cache cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
# The registry cache is useful as long as we need the same dependencies as another job, regardless of the Rust version and operating system.
key: cargo-registry-${{ hashFiles('Cargo.lock') }}-v3

- name: Cache cargo binaries
uses: actions/cache@v2
with:
path: |
~/.cargo/bin
~/.cargo/registry
target
key: ubuntu-rust-${{ steps.toolchain.outputs.rustc-hash }}
path: ~/.cargo/bin
# The cargo binary cache is useful as long as we use the same Rust version and operating system, but regardless of our dependencies.
key: ${{ matrix.os }}-cargo-binaries-${{ steps.toolchain.outputs.rustc_hash }}-v2

- name: Cache target directory
uses: actions/cache@v2
if: matrix.os == 'ubuntu-latest'
with:
path: target
# The target directory is only useful with the same Rust version, dependencies and operating system.
key: ${{ matrix.os }}-target-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('Cargo.lock') }}-build-v3

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

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

## Run e2e tests
- name: Install NodeJS 12.x
- name: Upload nectar-${{ matrix.os }} archive that contains the nectar binary
if: matrix.e2e
uses: actions/upload-artifact@v1
with:
name: nectar-${{ matrix.os }}
path: target/debug/nectar

- name: Install NodeJS 14.x
if: matrix.e2e
uses: actions/setup-node@v1
with:
node-version: '12.x'
node-version: '14.x'

- name: Cache node_modules directory
if: matrix.e2e
uses: actions/cache@v2
with:
path: api_tests/node_modules
key: ${{ matrix.os }}-node-modules-directory-${{ hashFiles('api_tests/package.json') }}
path: tests/node_modules
key: ${{ matrix.os }}-node-14-node-modules-directory-${{ hashFiles('tests/package.json') }}

- name: Run e2e tests
if: matrix.e2e
run: |
export PATH=$HOME/.cargo/bin:$HOME/.local/bin:$PATH
cd api_tests
cd tests
yarn install
yarn ci
yarn test
- name: Upload bitcoind log
if: matrix.e2e && failure()
uses: actions/upload-artifact@v2-preview
with:
name: e2e-logs-bitcoind.log
path: api_tests/log/bitcoind/regtest/debug.log
name: ${{ matrix.os }}-e2e-logs-bitcoind.log
path: tests/log/bitcoind/regtest/debug.log

- name: Upload parity log
if: matrix.e2e && failure()
uses: actions/upload-artifact@v2-preview
with:
name: e2e-logs-parity.log
path: api_tests/log/parity/parity.log
name: ${{ matrix.os }}-e2e-logs-parity.log
path: tests/log/parity/parity.log

- name: Upload lnd logs
if: matrix.e2e && failure()
uses: actions/upload-artifact@v2-preview
with:
name: e2e-logs-lnd
path: api_tests/log/lnd-*/logs/bitcoin/regtest/lnd.log
name: ${{ matrix.os }}-e2e-logs-lnd
path: tests/log/lnd-*/logs/bitcoin/regtest/lnd.log

- name: Upload e2e logs
if: matrix.e2e && failure()
uses: actions/upload-artifact@v2-preview
with:
name: e2e-test-logs
path: api_tests/log/tests/
name: ${{ matrix.os }}-e2e-test-logs
path: tests/log/tests/
36 changes: 36 additions & 0 deletions .github/workflows/create-cnd-gh-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "Create cnd GitHub release"

on:
pull_request:
branches:
- master
types:
- closed

jobs:
create_gh_release:
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/cnd/') # only merged release branches must trigger this
name: Create cnd GitHub release
runs-on: ubuntu-latest
steps:
- name: Checkout sources to access local actions
uses: actions/checkout@v2

- name: Extract version from branch name
id: extract-version
uses: ./.github/actions/trim-front
with:
string: ${{ github.event.pull_request.head.ref }}
prefix: release/cnd/

- name: Create Release
id: create-release
uses: thomaseizinger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.BOTTY_GITHUB_TOKEN }}
with:
target_commitish: ${{ github.event.pull_request.merge_commit_sha }}
tag_name: cnd-${{ steps.extract-version.outputs.trimmed }}
name: cnd-${{ steps.extract-version.outputs.trimmed }}
draft: false
prerelease: false
36 changes: 36 additions & 0 deletions .github/workflows/create-nectar-gh-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "Create nectar GitHub release"

on:
pull_request:
branches:
- master
types:
- closed

jobs:
create_gh_release:
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/nectar/') # only merged release branches must trigger this
name: Create nectar GitHub release
runs-on: ubuntu-latest
steps:
- name: Checkout sources to access local actions
uses: actions/checkout@v2

- name: Extract version from branch name
id: extract-version
uses: ./.github/actions/trim-front
with:
string: ${{ github.event.pull_request.head.ref }}
prefix: release/nectar/

- name: Create Release
id: create-release
uses: thomaseizinger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.BOTTY_GITHUB_TOKEN }}
with:
target_commitish: ${{ github.event.pull_request.merge_commit_sha }}
tag_name: nectar-${{ steps.extract-version.outputs.trimmed }}
name: nectar-${{ steps.extract-version.outputs.trimmed }}
draft: false
prerelease: false
Loading

0 comments on commit 67c9ed7

Please sign in to comment.