Skip to content

Commit

Permalink
style: run yamlfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Psycojoker committed Aug 7, 2024
1 parent b21d5b3 commit 9da828f
Show file tree
Hide file tree
Showing 15 changed files with 140 additions and 221 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@
---
name: Build

on:
push:
branches:
- dev
- main
pull_request:
branches:
- "*"

- '*'
jobs:
build:
runs-on: ubuntu-22.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }}
--password-stdin
- name: Download Docker cache image (if available)
run: docker pull ghcr.io/$GITHUB_REPOSITORY/build-cache || true

- name: Build the Docker image
run: |
git fetch --prune --unshallow --tags
docker build . -t pyaleph-node:${GITHUB_REF##*/} -f deployment/docker-build/pyaleph.dockerfile --cache-from=ghcr.io/$GITHUB_REPOSITORY/build-cache
- name: Push the image to the cache
# It's not possible to push packages from fork PRs.
if: github.event.pull_request.head.repo.full_name == github.repository
run: |
run: |-
docker tag pyaleph-node:${GITHUB_REF##*/} ghcr.io/$GITHUB_REPOSITORY/build-cache
docker push ghcr.io/$GITHUB_REPOSITORY/build-cache
9 changes: 2 additions & 7 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
---
name: Test code quality

on:
push:
branches:
- "*"

- '*'
jobs:
code-quality:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: Install pip and hatch
run: |
sudo apt-get install -y python3-pip
pip3 install hatch hatch-vcs
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-code-quality-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-code-quality-${{ hashFiles('pyproject.toml') }}
- name: Run Hatch lint
run: hatch run linting:all
28 changes: 12 additions & 16 deletions .github/workflows/nix-ci.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
---
name: Test nix-shell

on:
push:
branches:
- 'doesnt_exist'

- doesnt_exist
jobs:
nix-shell:
strategy:
matrix:
os: [ macos-latest, ubuntu-latest ]
os: [macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
with:
- uses: actions/checkout@v4
with:
# Fetch the whole history for all tags and branches (required for aleph.__version__)
fetch-depth: 0

- name: Set up Nix
uses: cachix/install-nix-action@v27
with:
fetch-depth: 0
- name: Set up Nix
uses: cachix/install-nix-action@v27
with:
# Use channel nixos-23.11 for Linux and nixpkgs-23.11-darwin for macOS
nix_path: nixpkgs=channel:${{ matrix.os == 'macos-latest' && 'nixpkgs-24.05-darwin' || 'nixos-24.05' }}

- name: Run tests
run: nix-shell --run "hatch run testing:test -- ./src/ ./test/"
nix_path: nixpkgs=channel:${{ matrix.os == 'macos-latest' && 'nixpkgs-24.05-darwin' || 'nixos-24.05' }}
- name: Run tests
run: nix-shell --run "hatch run testing:test -- ./src/ ./test/"
15 changes: 2 additions & 13 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
---
name: Test/Coverage with Python

on:
push:
branches:
- dev
- main
pull_request:
branches:
- "*"

- '*'
jobs:
tests:
runs-on: ubuntu-22.04
Expand All @@ -25,51 +24,41 @@ jobs:
image: redis:7.0.10
ports:
- 127.0.0.1:6379:6379


steps:
- uses: actions/checkout@v4
with:
# Fetch the whole history for all tags and branches (required for aleph.__version__)
fetch-depth: 0

- name: Set up Python 3.12
id: setup-python
uses: actions/setup-python@v2
with:
python-version: 3.12

- name: Install latest Rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true

- name: Set rust to nightly
run: |
rustup default nightly # Required to build some dependencies
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pytest-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pytest-${{ hashFiles('pyproject.toml') }}
- run: |
pip install hatch coverage
- run: |
sudo cp .github/openssl-ci.cnf /etc/ssl/openssl.cnf
export OPENSSL_CONF=/etc/ssl/openssl.cnf
touch config.yml # Fake config file for alembic
# TODO: determine why ResourceWarning warnings occur in some tests.
hatch run testing:test
- run: |
hatch run testing:cov
- uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
16 changes: 5 additions & 11 deletions .github/workflows/test-keygen.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,35 @@
---
name: Test keys generation

on:
push:
branches:
- main
pull_request:
branches:
- "*"

- '*'
jobs:
generate-keys:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }}
--password-stdin
- name: Download Docker cache image (if available)
run: docker pull ghcr.io/$GITHUB_REPOSITORY/build-cache || true

- name: Build the Docker image
run: |
git fetch --prune --unshallow --tags
docker build . -t alephim/pyaleph-node:${GITHUB_REF##*/} -f deployment/docker-build/pyaleph.dockerfile --cache-from=ghcr.io/$GITHUB_REPOSITORY/build-cache
- name: Tag the image
run: |
docker tag alephim/pyaleph-node:${GITHUB_REF##*/} ghcr.io/$GITHUB_REPOSITORY/build-cache
- name: Generate keys
run: |
mkdir keys
docker run --rm --user root --entrypoint "" -v $(pwd)/keys:/opt/pyaleph/keys alephim/pyaleph-node:${GITHUB_REF##*/} chown aleph:aleph /opt/pyaleph/keys
docker run --rm --entrypoint "" -v $(pwd)/keys:/opt/pyaleph/keys alephim/pyaleph-node:${GITHUB_REF##*/} pyaleph --gen-keys --key-dir /opt/pyaleph/keys
- name: Ensure keys exists
run: |
run: |-
ls keys/node-pub.key
ls keys/node-secret.pkcs8.der
9 changes: 3 additions & 6 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
---
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Build documentation with MkDocs
#mkdocs:
# mkdocs:
# configuration: mkdocs.yml

# Optionally build your docs in additional formats such as PDF and ePub
formats: all

build:
os: ubuntu-22.04
tools:
python: "3.12"

python: '3.12'
# Optionally set the version of Python and requirements required to build your docs
python:
install:
Expand Down
71 changes: 32 additions & 39 deletions deployment/docker-build/config.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,42 @@
---
nuls2:
chain_id: 1
enabled: False
packing_node: False
sync_address: NULSd6HgUkssMi6oSjwEn3puNSijLKnyiRV7H
api_url: https://apiserver.nuls.io/
explorer_url: https://nuls.world/
token_contract: NULSd6Hh1FjbnAktH1FFvFnTzfgFnZtgAhYut

chain_id: 1
enabled: false
packing_node: false
sync_address: NULSd6HgUkssMi6oSjwEn3puNSijLKnyiRV7H
api_url: https://apiserver.nuls.io/
explorer_url: https://nuls.world/
token_contract: NULSd6Hh1FjbnAktH1FFvFnTzfgFnZtgAhYut
ethereum:
enabled: False
enabled: false
# api_url: {{ ALEPH_ETHEREUM_URL }}
chain_id: 1
packing_node: False
sync_contract: "0x166fd4299364B21c7567e163d85D78d2fb2f8Ad5"
start_height: 11474360
token_contract: "0x27702a26126e0B3702af63Ee09aC4d1A084EF628"
token_start_height: 10939074

chain_id: 1
packing_node: false
sync_contract: '0x166fd4299364B21c7567e163d85D78d2fb2f8Ad5'
start_height: 11474360
token_contract: '0x27702a26126e0B3702af63Ee09aC4d1A084EF628'
token_start_height: 10939074
binancechain:
enabled: False
packing_node: False

enabled: false
packing_node: false
mongodb:
uri: "mongodb://127.0.0.1:27017"
database: aleph

uri: mongodb://127.0.0.1:27017
database: aleph
storage:
store_files: true
engine: mongodb

store_files: true
engine: mongodb
ipfs:
enabled: True
host: 127.0.0.1
port: 5001
gateway_port: 8080

enabled: true
host: 127.0.0.1
port: 5001
gateway_port: 8080
aleph:
queue_topic: ALEPH-TEST

queue_topic: ALEPH-TEST
p2p:
host: 0.0.0.0
http_port: 4024
port: 4025
control_port: 4030
reconnect_delay: 60

host: 0.0.0.0
http_port: 4024
port: 4025
control_port: 4030
reconnect_delay: 60
sentry:
dsn: null
dsn:
Loading

0 comments on commit 9da828f

Please sign in to comment.