Skip to content

Commit

Permalink
ci: Update hedera-local-node for CI best practices (#592)
Browse files Browse the repository at this point in the history
Signed-off-by: Roger Barker <[email protected]>
  • Loading branch information
rbarkerSL authored May 6, 2024
1 parent 2719c51 commit 4be3e95
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 24 deletions.
39 changes: 39 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
###################################
##### Global Protection Rule ######
###################################
# NOTE: This rule is overriden by the more specific rules below. This is the catch-all rule for all files not covered by the more specific rules below.
* @georgi-l95 @isavov @Ivo-Yankov @natanasow @konstantinabl @Ivo-Yankov @victor-yanev

#########################
##### Core Files ######
#########################

# NOTE: Must be placed last to ensure enforcement over all other rules

# Protection Rules for Github Configuration Files and Actions Workflows
/.github/ @hashgraph/release-engineering @hashgraph/release-engineering-managers

# Cmake project files and inline plugins
**/.clang* @hashgraph/release-engineering @hashgraph/release-engineering-managers @hashgraph/hedera-sdk
**/.clang-format @hashgraph/release-engineering @hashgraph/release-engineering-managers @hashgraph/hedera-sdk
**/.clang-tidy @hashgraph/release-engineering @hashgraph/release-engineering-managers @hashgraph/hedera-sdk
**/CMakeLists.txt @hashgraph/release-engineering @hashgraph/release-engineering-managers @hashgraph/hedera-sdk
**/CMakePresets.json @hashgraph/release-engineering @hashgraph/release-engineering-managers @hashgraph/hedera-sdk

# Codacy Tool Configurations
/config/ @hashgraph/release-engineering @hashgraph/release-engineering-managers
.remarkrc @hashgraph/release-engineering @hashgraph/release-engineering-managers

# Self-protection for root CODEOWNERS files (this file should not exist and should definitely require approval)
/CODEOWNERS @hashgraph/release-engineering @hashgraph/release-engineering-managers

# Protect the repository root files
/README.md @hashgraph/release-engineering @hashgraph/release-engineering-managers
**/LICENSE @hashgraph/release-engineering @hashgraph/release-engineering-managers

# CodeCov configuration
**/codecov.yml @hashgraph/release-engineering @hashgraph/release-engineering-managers

# Git Ignore definitions
**/.gitignore @hashgraph/release-engineering @hashgraph/release-engineering-managers
**/.gitignore.* @hashgraph/release-engineering @hashgraph/release-engineering-managers
31 changes: 31 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: 2
updates:
- package-ecosystem: docker
directory: /docker/main-network-node
schedule:
interval: daily

- package-ecosystem: docker
directory: /docker/network-node-base
schedule:
interval: daily

- package-ecosystem: docker
directory: /docker/network-node-haveged
schedule:
interval: daily

- package-ecosystem: npm
directory: /
schedule:
interval: daily

- package-ecosystem: npm
directory: /test/cypress
schedule:
interval: daily

- package-ecosystem: npm
directory: /test/smoke
schedule:
interval: daily
5 changes: 2 additions & 3 deletions .github/workflows/flow-pr-title-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ defaults:
shell: bash

permissions:
contents: read
statuses: write

concurrency:
Expand All @@ -40,10 +41,8 @@ jobs:
title-check:
name: Title Check
runs-on: [self-hosted, Linux, medium, ephemeral]
permissions:
statuses: write
steps:
- name: Check PR Title
uses: aslafy-z/conventional-pr-title-action@v3
uses: aslafy-z/conventional-pr-title-action@a0b851005a0f82ac983a56ead5a8111c0d8e044a # v3.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32 changes: 19 additions & 13 deletions .github/workflows/flow-pull-request-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,17 @@ defaults:
run:
shell: bash

permissions:
contents: read

concurrency:
group: pr-checks-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
smoke-tests:
name: Smoke Tests
runs-on: ubuntu-latest
runs-on: [self-hosted, Linux, medium, ephemeral]

strategy:
fail-fast: false
Expand All @@ -47,10 +50,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ matrix.node-version }}
cache: npm
Expand All @@ -65,7 +68,7 @@ jobs:
run: npm run start -- --network ${{ matrix.network }} -d

- name: Run smoke test
uses: nick-fields/retry@v2
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.2.0
with:
max_attempts: 3
timeout_minutes: 3
Expand All @@ -76,7 +79,7 @@ jobs:

browser-tests:
name: Browser Tests
runs-on: ubuntu-latest
runs-on: [self-hosted, Linux, large, ephemeral ]

strategy:
fail-fast: false
Expand All @@ -85,16 +88,20 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ matrix.node-version }}
cache: npm

- name: Install dependencies
run: npm ci
run: |
sudo apt-get update
sudo apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev -y
sudo apt-get install libnss3 libxss1 libasound2 libxtst6 xauth xvfb -y
npm ci
- name: Start local node
run: npm run start -- -d
Expand All @@ -112,7 +119,7 @@ jobs:

unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
runs-on: [self-hosted, Linux, medium, ephemeral]

strategy:
fail-fast: false
Expand All @@ -121,10 +128,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ matrix.node-version }}
cache: npm
Expand All @@ -137,5 +144,4 @@ jobs:

- name: Upload coverage report
if: ${{ always() && !cancelled() }}
uses: codecov/codecov-action@v3

uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed # v4.3.0
14 changes: 11 additions & 3 deletions .github/workflows/publish-npm-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@ name: Publish Package to npmjs
on:
release:
types: [published]

permissions:
contents: read

defaults:
run:
shell: bash

jobs:
publish-npm-package:
runs-on: ubuntu-latest
runs-on: [ self-hosted, Linux, medium, ephemeral ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Use Node.js 20.x
uses: actions/setup-node@v4
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/zxf-publish-docker-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ env:
jobs:
prepare-release:
name: Release / Prepare
runs-on: [ self-hosted, Linux, large, ephemeral ]
runs-on: [self-hosted, Linux, large, ephemeral]
outputs:
version: ${{ steps.extract.outputs.version }}
tag: ${{ steps.extract.outputs.tag }}
steps:
- name: Checkout Code
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pinned to v3.3.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install Semantic Version Tools
run: |
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
- prepare-release
steps:
- name: Checkout Code
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pinned to v3.3.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Authenticate to Google Cloud
id: google-auth
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
- prepare-release
steps:
- name: Checkout Code
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pinned to v3.3.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Authenticate to Google Cloud
id: google-auth
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ network-logs/**
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
**/*.iml

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
Expand Down Expand Up @@ -161,4 +162,4 @@ network-logs/minio-server/data/**
.nyc_output

### Codecov coverage report files directory
coverage
coverage

0 comments on commit 4be3e95

Please sign in to comment.