Compare commits
16 Commits
master
...
sevey/comp
Author | SHA1 | Date |
---|---|---|
Matthew Sevey | ac15135099 | |
Matthew Sevey | a6ec306528 | |
Matthew Sevey | 65dafd2663 | |
Matthew Sevey | 112ec3d78f | |
Matthew Sevey | d86c2d2982 | |
Matthew Sevey | a4a75a1a6f | |
Matthew Sevey | be1a890cc9 | |
Matthew Sevey | e083a73be5 | |
Matthew Sevey | 489610fccd | |
Matthew Sevey | 44925c82ce | |
Matthew Sevey | 05922d9c5a | |
Matthew Sevey | 075c8eac40 | |
Matthew Sevey | 747a1918e0 | |
Matthew Sevey | a986197c49 | |
Matthew Sevey | 2b9b1ec323 | |
Matthew Sevey | eee48729d7 |
|
@ -0,0 +1,22 @@
|
|||
# Define action name, description, and inputs
|
||||
name: "Node Action"
|
||||
description: "Execute a node action"
|
||||
inputs:
|
||||
working-directory:
|
||||
required: false
|
||||
description: "Working directory"
|
||||
default: "."
|
||||
node-action:
|
||||
required: true
|
||||
description: "The action to be run"
|
||||
|
||||
# Define action steps
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
- run: $inputs.node-action
|
||||
shell: bash
|
||||
working-directory: ${{ inputs.working-directory }}
|
|
@ -0,0 +1,174 @@
|
|||
name: CI and Release
|
||||
|
||||
on:
|
||||
push:
|
||||
schedule:
|
||||
# Run daily at 1:15am
|
||||
- cron: "15 1 * * *"
|
||||
workflow_dispatch:
|
||||
# Inputs the workflow accepts.
|
||||
inputs:
|
||||
version:
|
||||
# Friendly description to be shown in the UI instead of 'name'
|
||||
description: "Semver type of new version (major / minor / patch)"
|
||||
# Input has to be provided for the workflow to run
|
||||
required: true
|
||||
type: choice
|
||||
options:
|
||||
- patch
|
||||
- minor
|
||||
- major
|
||||
|
||||
jobs:
|
||||
# Determine what the js changes are
|
||||
js-changes:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
packages: ${{ steps.filter.outputs.changes }}
|
||||
steps:
|
||||
# Use paths-filter to determine which paths have changes
|
||||
# https://github.com/dorny/paths-filter
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
# Format of key: value. When there is a change detected in value, the
|
||||
# key will be returned in the output.
|
||||
filters: |
|
||||
packages/dashboard: packages/dashboard/**
|
||||
packages/dashboard-v2: packages/dashboard-v2/**
|
||||
packages/dnslink-api: packages/dnslink-api/**
|
||||
packages/handshake-api: packages/handshake-api/**
|
||||
packages/health-check: packages/health-check/**
|
||||
packages/website: packages/website/**
|
||||
|
||||
# Run the prettier lint if there are changes to any of the js packages
|
||||
prettier:
|
||||
needs: js-changes
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
working-directory: ${{ fromJSON(needs.js-changes.outputs.packages) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Run JS-Lint Action
|
||||
uses: SkynetLabs/.github/.github/actions/prettier@master
|
||||
with:
|
||||
working-directory: ${{ matrix.working-directory }}
|
||||
|
||||
# Run the eslint if there were changes to the dashboard packages
|
||||
eslint:
|
||||
needs: js-changes
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
working-directory: ${{ fromJSON(needs.js-changes.outputs.packages) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Run yarn next lint on packages/dashboard
|
||||
uses: ./.github/actions/node-action
|
||||
if: ${{ matrix.working-directory == 'packages/dashboard' }}
|
||||
with:
|
||||
working-directory: ${{ matrix.working-directory }}
|
||||
node-action: yarn next lint
|
||||
- name: Run yarn lint on packages/dashboard-v2
|
||||
uses: ./.github/actions/node-action
|
||||
if: ${{ matrix.working-directory == 'packages/dashboard-v2' }}
|
||||
with:
|
||||
working-directory: ${{ matrix.working-directory }}
|
||||
node-action: yarn lint
|
||||
|
||||
# Determine what the dockerfile changes are
|
||||
dockerfile-changes:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
packages: ${{ steps.filter.outputs.changes }}
|
||||
steps:
|
||||
# Use paths-filter to determine which paths have changes
|
||||
# https://github.com/dorny/paths-filter
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
# Format of key: value. When there is a change detected in value, the
|
||||
# key will be returned in the output.
|
||||
filters: |
|
||||
docker/nginx/Dockerfile: docker/nginx/Dockerfile
|
||||
docker/sia/Dockerfile: docker/sia/Dockerfile
|
||||
packages/dashboard/Dockerfile: packages/dashboard/Dockerfile
|
||||
packages/dnslink-api/Dockerfile: packages/dnslink-api/Dockerfile
|
||||
packages/handshake-api/Dockerfile: packages/handshake-api/Dockerfile
|
||||
packages/health-check/Dockerfile: packages/health-check/Dockerfile
|
||||
packages/website/Dockerfile: packages/website/Dockerfile
|
||||
|
||||
# Run the hadolint dockefile lint if there are changes to any of the
|
||||
# dockerfiles
|
||||
hadolint:
|
||||
needs: dockerfile-changes
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
dockerfile: ${{ fromJSON(needs.dockerfile-changes.outputs.packages) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: hadolint/hadolint-action@v2.1.0
|
||||
with:
|
||||
dockerfile: ${{ matrix.dockerfile }}
|
||||
|
||||
# Determine if there are python changes
|
||||
python-changes:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
# Check if the changed status of py is true
|
||||
updates: steps.filter.outputs.py == 'true'
|
||||
steps:
|
||||
# Use paths-filter to determine which paths have changes
|
||||
# https://github.com/dorny/paths-filter
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
py: "**.py"
|
||||
|
||||
# Run the hadolint dockefile lint if there are changes to any of the
|
||||
# dockerfiles
|
||||
python-lint:
|
||||
needs: python-changes
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Run Black python linter
|
||||
if: ${{ needs.python-changes.outputs.updates }}
|
||||
uses: SkynetLabs/.github/.github/actions/python-black-lint@master
|
||||
- name: Run Flake8 python linter
|
||||
if: ${{ needs.python-changes.outputs.updates }}
|
||||
uses: SkynetLabs/.github/.github/actions/python-flake8-lint@master
|
||||
|
||||
# Check if there were any changes since the last tag if this is not a push
|
||||
# event
|
||||
changes:
|
||||
needs: [prettier, eslint, hadolint, python-lint]
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
updates: ${{steps.changes.outputs.any == 'true'}}
|
||||
if: ${{ github.event_name != 'push' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0 # Required due to the weg Git works, without it this action won't be able to find any or the correct tags
|
||||
- uses: SkynetLabs/.github/.github/actions/changes-since-last-tag@master
|
||||
|
||||
# Make a release if
|
||||
# - there were changes and this is a scheduled job
|
||||
# - This is a manually trigger job, i.e. workflow_dispatch
|
||||
release:
|
||||
needs: changes
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ (needs.changes.outputs.updates == 'true' && github.event_name == 'schedule') || github.event_name == 'workflow_dispatch' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Version Release
|
||||
uses: SkynetLabs/.github/.github/actions/version-release@master
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
|
@ -1,28 +0,0 @@
|
|||
name: Dockerfile Lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
hadolint:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
dockerfile:
|
||||
- docker/nginx/Dockerfile
|
||||
- docker/sia/Dockerfile
|
||||
- packages/dashboard/Dockerfile
|
||||
- packages/dashboard-v2/Dockerfile
|
||||
- packages/dnslink-api/Dockerfile
|
||||
- packages/handshake-api/Dockerfile
|
||||
- packages/health-check/Dockerfile
|
||||
- packages/website/Dockerfile
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: hadolint/hadolint-action@v2.0.0
|
||||
with:
|
||||
dockerfile: ${{ matrix.dockerfile }}
|
|
@ -1,24 +0,0 @@
|
|||
name: Lint - packages/dashboard-v2
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- packages/dashboard-v2/**
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/dashboard-v2
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16.x
|
||||
|
||||
- run: yarn
|
||||
- run: yarn prettier --check
|
||||
- run: yarn lint
|
|
@ -1,24 +0,0 @@
|
|||
name: Lint - packages/dashboard
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- packages/dashboard/**
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/dashboard
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16.x
|
||||
|
||||
- run: yarn
|
||||
- run: yarn prettier --check .
|
||||
- run: yarn next lint
|
|
@ -1,23 +0,0 @@
|
|||
name: Lint - packages/dnslink-api
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- packages/dnslink-api/**
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/dnslink-api
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16.x
|
||||
|
||||
- run: yarn
|
||||
- run: yarn prettier --check .
|
|
@ -1,23 +0,0 @@
|
|||
name: Lint - packages/handshake-api
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- packages/handshake-api/**
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/handshake-api
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16.x
|
||||
|
||||
- run: yarn
|
||||
- run: yarn prettier --check .
|
|
@ -1,23 +0,0 @@
|
|||
name: Lint - packages/health-check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- packages/health-check/**
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/health-check
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16.x
|
||||
|
||||
- run: yarn
|
||||
- run: yarn prettier --check .
|
|
@ -1,23 +0,0 @@
|
|||
name: Lint - packages/website
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- packages/website/**
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/website
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16.x
|
||||
|
||||
- run: yarn
|
||||
- run: yarn prettier --check .
|
|
@ -1,37 +0,0 @@
|
|||
name: Lint - Python Scripts
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- "**.py"
|
||||
|
||||
jobs:
|
||||
black:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: "3.x"
|
||||
architecture: x64
|
||||
|
||||
- run: pip install black
|
||||
- run: black --check .
|
||||
|
||||
flake8:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: "3.x"
|
||||
architecture: x64
|
||||
|
||||
- run: pip install flake8
|
||||
|
||||
# E203: https://www.flake8rules.com/rules/E203.html - Whitespace before ':'
|
||||
# E501: https://www.flake8rules.com/rules/E501.html - Line too long
|
||||
# W503: https://www.flake8rules.com/rules/W503.html - Line break occurred before a binary operator
|
||||
# W605: https://www.flake8rules.com/rules/W605.html - Invalid escape sequence
|
||||
# E722: https://www.flake8rules.com/rules/E722.html - Do not use bare except, specify exception instead
|
||||
- run: flake8 --max-line-length 88 --ignore E203,E501,W503,W605,E722
|
|
@ -12,5 +12,6 @@ FROM nebulouslabs/sia:1.5.6
|
|||
|
||||
COPY --from=sia-builder /go/bin/ /usr/bin/
|
||||
|
||||
# rename binaries to old siac siad naming
|
||||
RUN if [ -f "/usr/bin/skyd" ]; then mv /usr/bin/skyd /usr/bin/siad; fi && \
|
||||
if [ -f "/usr/bin/skyc" ]; then mv /usr/bin/skyc /usr/bin/siac; fi
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# Dashboard
|
||||
|
||||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
|
||||
|
||||
## Getting Started
|
||||
|
|
|
@ -195,6 +195,7 @@ async function blockerHealthCheck(done) {
|
|||
done({ name: "blocker", time: calculateElapsedTime(time), ...data });
|
||||
}
|
||||
|
||||
// genericAccessCheck
|
||||
async function genericAccessCheck(name, url) {
|
||||
const authCookie = await getAuthCookie();
|
||||
const time = process.hrtime();
|
||||
|
|
|
@ -43,6 +43,7 @@ DISK_USAGE_DUMP_LOG = "../../devops/disk-monitor/disk-usage-dump.log"
|
|||
setup()
|
||||
|
||||
|
||||
# run_checks runs the health checks
|
||||
async def run_checks():
|
||||
print("Running Skynet portal health checks")
|
||||
try:
|
||||
|
|
Reference in New Issue