-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48db6aa
commit d812d84
Showing
15 changed files
with
140 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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 }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
Oops, something went wrong.