-
Notifications
You must be signed in to change notification settings - Fork 7
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
Showing
144 changed files
with
10,225 additions
and
2,641 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
tests | ||
helper-scripts | ||
dist | ||
build | ||
.github | ||
.gitmodules |
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,3 +1,3 @@ | ||
[flake8] | ||
max-line-length = 100 | ||
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist,venv | ||
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist,venv,helper-scripts |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: pip | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
day: saturday | ||
open-pull-requests-limit: 10 |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Get linked issues | ||
on: | ||
pull_request: | ||
types: [ edited, synchronize, opened, reopened ] | ||
|
||
jobs: | ||
check-linked-issues: | ||
name: Check if pull request has linked issues | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get issues | ||
id: get-issues | ||
uses: mondeja/pr-linked-issues-action@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
- name: PR has not linked issues | ||
if: join(steps.get-issues.outputs.issues) == '' | ||
run: | ||
exit 1 |
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 |
---|---|---|
@@ -0,0 +1,179 @@ | ||
name: Build and publish | ||
on: | ||
pull_request: | ||
types: [closed] | ||
branches: | ||
- master | ||
- develop | ||
- beta | ||
- stable | ||
- v*.*.* | ||
|
||
jobs: | ||
create_release: | ||
if: github.event.pull_request.merged | ||
name: Create release | ||
runs-on: ubuntu-20.04 | ||
outputs: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
version: ${{ steps.export_outputs.outputs.version }} | ||
branch: ${{ steps.export_outputs.outputs.branch }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: Checkout submodules | ||
run: git submodule update --init | ||
- name: Install ubuntu dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install python-setuptools | ||
- name: Set Versions | ||
run: | | ||
bash ./scripts/set_versions_ga.sh | ||
- name: Set release | ||
run: | | ||
if [[ "$BRANCH" == "stable" ]]; then | ||
export PRERELEASE=false | ||
else | ||
export PRERELEASE=true | ||
fi | ||
echo "PRERELEASE=$PRERELEASE" >> $GITHUB_ENV | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ env.VERSION }} | ||
release_name: ${{ env.VERSION }} | ||
draft: false | ||
prerelease: ${{ env.PRERELEASE }} | ||
- name: Export outputs | ||
id: export_outputs | ||
run: | | ||
echo "::set-output name=version::$VERSION" | ||
echo "::set-output name=branch::$BRANCH" | ||
build_and_publish_normal: | ||
if: github.event.pull_request.merged | ||
needs: create_release | ||
name: Build and publish for ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-20.04 | ||
asset_name: skale-${{ needs.create_release.outputs.version }}-Linux-x86_64 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install ubuntu dependencies | ||
if: matrix.os == 'ubuntu-20.04' | ||
run: | | ||
sudo apt-get update | ||
- name: Checkout submodules | ||
run: git submodule update --init | ||
|
||
- name: Build normal binary | ||
run: | | ||
mkdir -p ./dist | ||
docker build . -t node-cli-builder | ||
docker run -v /home/ubuntu/dist:/app/dist node-cli-builder scripts/build.sh ${{ needs.create_release.outputs.version }} ${{ needs.create_release.outputs.branch }} normal | ||
ls -altr /home/ubuntu/dist/ | ||
docker rm -f $(docker ps -aq) | ||
- name: Save sha512sum | ||
run: | | ||
sudo sha512sum /home/ubuntu/dist/${{ matrix.asset_name }} | sudo tee > /dev/null /home/ubuntu/dist/sha512sum | ||
- name: Upload release binary | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create_release.outputs.upload_url }} | ||
asset_path: /home/ubuntu/dist/${{ matrix.asset_name }} | ||
asset_name: ${{ matrix.asset_name }} | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload release checksum | ||
id: upload-release-checksum | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create_release.outputs.upload_url }} | ||
asset_path: /home/ubuntu/dist/sha512sum | ||
asset_name: ${{ matrix.asset_name }}.sha512 | ||
asset_content_type: text/plain | ||
|
||
build_and_publish_sync: | ||
if: github.event.pull_request.merged | ||
needs: create_release | ||
name: Build and publish for ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-20.04 | ||
asset_name: skale-${{ needs.create_release.outputs.version }}-Linux-x86_64-sync | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install ubuntu dependencies | ||
if: matrix.os == 'ubuntu-20.04' | ||
run: | | ||
sudo apt-get update | ||
- name: Checkout submodules | ||
run: git submodule update --init | ||
|
||
- name: Build sync release binary | ||
run: | | ||
mkdir -p ./dist | ||
docker build . -t node-cli-builder | ||
docker run -v /home/ubuntu/dist:/app/dist node-cli-builder scripts/build.sh ${{ needs.create_release.outputs.version }} ${{ needs.create_release.outputs.branch }} sync | ||
ls -altr /home/ubuntu/dist/ | ||
docker rm -f $(docker ps -aq) | ||
- name: Save sha512sum | ||
run: | | ||
sudo sha512sum /home/ubuntu/dist/${{ matrix.asset_name }} | sudo tee > /dev/null /home/ubuntu/dist/sha512sum | ||
- name: Upload release sync CLI | ||
id: upload-sync-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create_release.outputs.upload_url }} | ||
asset_path: /home/ubuntu/dist/${{ matrix.asset_name }} | ||
asset_name: ${{ matrix.asset_name }} | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload release sync CLI checksum | ||
id: upload-sync-release-checksum | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create_release.outputs.upload_url }} | ||
asset_path: /home/ubuntu/dist/sha512sum | ||
asset_name: ${{ matrix.asset_name }}.sha512 | ||
asset_content_type: text/plain |
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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Test | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
python-version: [3.11] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: Checkout submodules | ||
run: git submodule update --init | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install ubuntu dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install python-setuptools iptables | ||
- name: Install python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e . | ||
pip install -e .[dev] | ||
pip install --upgrade 'setuptools<45.0.0' | ||
- name: Lint with flake8 | ||
run: | | ||
flake8 . | ||
- name: Build binary in Ubuntu 18.04 environment - normal | ||
run: | | ||
mkdir -p ./dist | ||
docker build . -t node-cli-builder | ||
docker run -v /home/ubuntu/dist:/app/dist node-cli-builder scripts/build.sh test test normal | ||
docker rm -f $(docker ps -aq) | ||
- name: Check build - normal | ||
run: sudo /home/ubuntu/dist/skale-test-Linux-x86_64 | ||
|
||
- name: Build binary in Ubuntu 20.04 environment - normal | ||
run: | | ||
scripts/build.sh test test normal | ||
- name: Check build - sync | ||
run: sudo /home/ubuntu/dist/skale-test-Linux-x86_64 | ||
- name: Build sync binary in Ubuntu 18.04 environment | ||
run: | | ||
mkdir -p ./dist | ||
docker build . -t node-cli-builder | ||
docker run -v /home/ubuntu/dist:/app/dist node-cli-builder scripts/build.sh test test sync | ||
docker rm -f $(docker ps -aq) | ||
- name: Check build - sync | ||
run: sudo /home/ubuntu/dist/skale-test-Linux-x86_64-sync | ||
|
||
- name: Build sync binary in Ubuntu 20.04 environment | ||
run: | | ||
scripts/build.sh test test sync | ||
- name: Check build - sync | ||
run: sudo /home/ubuntu/dist/skale-test-Linux-x86_64-sync | ||
|
||
- name: Run tests | ||
run: bash ./scripts/run_tests.sh |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[submodule "helper-scripts"] | ||
path = helper-scripts | ||
url = https://github.com/skalenetwork/helper-scripts.git | ||
branch = develop | ||
|
||
[submodule "lvmpy"] | ||
path = lvmpy | ||
url = https://github.com/skalenetwork/docker-lvmpy | ||
branch = develop |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.