Skip to content

Commit

Permalink
Merge pull request #4 from lateminer/rust-qtum-update-to-upstream
Browse files Browse the repository at this point in the history
Update to upstream
  • Loading branch information
alejoacosta74 authored Dec 28, 2023
2 parents c444bf6 + e9e6031 commit 91b7a9e
Show file tree
Hide file tree
Showing 1,162 changed files with 17,050 additions and 10,601 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Set update schedule for GitHub Actions
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
60 changes: 43 additions & 17 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,64 @@
# Automatically generated by fuzz/generate-files.sh
name: Fuzz

on: [push, pull_request]
on:
push:
branches:
- master
- 'test-ci/**'
pull_request:

jobs:

fuzz:
if: ${{ !github.event.act }}
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
fuzz_target: [deser_net_msg, deserialize_address, deserialize_amount, deserialize_block, deserialize_psbt, deserialize_script, deserialize_transaction, deserialize_prefilled_transaction, deserialize_witness, outpoint_string, script_bytes_to_asm_fmt]
fuzz_target: [
bitcoin_deserialize_address,
bitcoin_deserialize_block,
bitcoin_deserialize_prefilled_transaction,
bitcoin_deserialize_psbt,
bitcoin_deserialize_script,
bitcoin_deserialize_transaction,
bitcoin_deserialize_witness,
bitcoin_deser_net_msg,
bitcoin_outpoint_string,
bitcoin_script_bytes_to_asm_fmt,
hashes_cbor,
hashes_json,
hashes_ripemd160,
hashes_sha1,
hashes_sha256,
hashes_sha512_256,
hashes_sha512,
units_deserialize_amount,
]
steps:
- name: Install test dependencies
run: sudo apt-get update -y && sudo apt-get install -y binutils-dev libunwind8-dev libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc libiberty-dev
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/checkout@v4
- uses: actions/cache@v3
id: cache-fuzz
with:
path: |
~/.cargo/bin
fuzz/target
target
key: cache-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.58
override: true
profile: minimal
toolchain: '1.65.0'
- name: fuzz
run: cd bitcoin/fuzz && ./travis-fuzz.sh "${{ matrix.fuzz_target }}"
- run: echo "${{ matrix.fuzz_target }}.rs" >executed_${{ matrix.fuzz_target }}
- uses: actions/upload-artifact@v2
run: |
if [[ "${{ matrix.fuzz_target }}" =~ ^bitcoin ]]; then
export RUSTFLAGS='--cfg=hashes_fuzz --cfg=secp256k1_fuzz'
fi
echo "Using RUSTFLAGS $RUSTFLAGS"
cd fuzz && ./fuzz.sh "${{ matrix.fuzz_target }}"
- run: echo "${{ matrix.fuzz_target }}" >executed_${{ matrix.fuzz_target }}
- uses: actions/upload-artifact@v3
with:
name: executed_${{ matrix.fuzz_target }}
path: executed_${{ matrix.fuzz_target }}
Expand All @@ -41,10 +68,9 @@ jobs:
needs: fuzz
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
- name: Display structure of downloaded files
run: ls -R
- run: find executed_* -type f -exec cat {} + | sort > executed
- run: ls bitcoin/fuzz/fuzz_targets | sort > expected
- run: diff expected executed
- run: source ./fuzz/fuzz-util.sh && listTargetNames | sort | diff - executed
15 changes: 15 additions & 0 deletions .github/workflows/gh-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: GitHub Release

on:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
4 changes: 2 additions & 2 deletions .github/workflows/kani.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: 'Checkout your code.'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Run Kani on your code.'
uses: model-checking/kani-github-action@v0.15
uses: model-checking/kani-github-action@v1.0
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on:
push:
branches:
- master
- 0.28.x
- 0.29.x
- 'test-ci/**'
pull_request:

name: Release

jobs:
release:
name: Release - dry-run
runs-on: ubuntu-latest
steps:
- name: Checkout Crate
uses: actions/checkout@v4
- name: Checkout Toolchain
uses: dtolnay/rust-toolchain@stable
- name: run cargo
run: contrib/release.sh
55 changes: 23 additions & 32 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
on: [push, pull_request]
on:
push:
branches:
- master
- 'test-ci/**'
pull_request:

name: Continuous integration

Expand All @@ -10,16 +15,14 @@ jobs:
fail-fast: false
steps:
- name: Checkout Crate
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Checkout Toolchain
# https://github.com/dtolnay/rust-toolchain
uses: dtolnay/rust-toolchain@stable
- name: Running test script
env:
DO_COV: true
DO_LINT: true
AS_DEPENDENCY: false
DO_NO_STD: true
DO_DOCS: true
DO_FEATURE_MATRIX: true
DO_SCHEMARS_TESTS: true # Currently only used in hashes crate.
Expand All @@ -32,13 +35,12 @@ jobs:
fail-fast: false
steps:
- name: Checkout Crate
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Checkout Toolchain
uses: dtolnay/rust-toolchain@beta
- name: Running test script
env:
AS_DEPENDENCY: false
DO_NO_STD: true
run: ./contrib/test.sh

Nightly:
Expand All @@ -48,54 +50,43 @@ jobs:
fail-fast: false
steps:
- name: Checkout Crate
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Checkout Toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Install clippy
run: rustup component add clippy
- name: Running test script
env:
DO_FMT: true
DO_LINT: true
DO_FMT: false
DO_BENCH: true
AS_DEPENDENCY: false
DO_NO_STD: true
DO_DOCSRS: true
run: ./contrib/test.sh

MSRV:
name: Test - 1.41.1 toolchain
name: Test - 1.56.1 toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout Crate
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Checkout Toolchain
uses: dtolnay/[email protected]
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.56.1"
- name: Running test script
env:
DO_FEATURE_MATRIX: true
run: ./contrib/test.sh

NoStd:
name: Test - 1.47 toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout Crate
uses: actions/checkout@v3
- name: Checkout Toolchain
uses: dtolnay/[email protected]
- name: Running test script
env:
DO_NO_STD: true
run: ./contrib/test.sh

Arch32bit:
name: Test 32-bit version
runs-on: ubuntu-latest
steps:
- name: Checkout Crate
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Checkout Toolchain
uses: dtolnay/rust-toolchain@stable
- name: Add architecture i386
Expand All @@ -113,7 +104,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Crate
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Checkout Toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install target
Expand All @@ -130,7 +121,7 @@ jobs:
CARGO_TARGET_THUMBV7M_NONE_EABI_RUNNER: "qemu-system-arm -cpu cortex-m3 -machine mps2-an385 -nographic -semihosting-config enable=on,target=native -kernel"
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up QEMU
run: sudo apt update && sudo apt install -y qemu-system-arm gcc-arm-none-eabi
- name: Checkout Toolchain
Expand All @@ -151,7 +142,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Crate
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Checkout Toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Install src
Expand All @@ -166,7 +157,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Crate
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Checkout Toolchain
uses: dtolnay/rust-toolchain@stable
- name: Running WASM build
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/rustfmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Nightly rustfmt
on:
schedule:
- cron: "0 0 * * 0" # runs weekly on Sunday at 00:00
workflow_dispatch: # allows manual triggering
jobs:
format:
name: Nightly rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Run Nightly rustfmt
run: cargo +nightly fmt
- name: Get the current date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
author: Fmt Bot <[email protected]>
title: Automated nightly rustfmt (${{ env.date }})
body: |
Automated nightly `rustfmt` changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
commit-message: ${{ env.date }} automated rustfmt nightly
labels: rustfmt
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,5 @@ hashes/target
bitcoin/dep_test

# Fuzz artifacts
bitcoin/fuzz/hfuzz_target
bitcoin/fuzz/hfuzz_workspace
hashes/fuzz/hfuzz_target
hashes/fuzz/hfuzz_workspace
hfuzz_target
hfuzz_workspace
Loading

0 comments on commit 91b7a9e

Please sign in to comment.