Skip to content

Commit

Permalink
Merge pull request #66 from skalenetwork/DmytroNazarenko-patch-1
Browse files Browse the repository at this point in the history
Update main.yml
  • Loading branch information
DmytroNazarenko authored Jan 23, 2024
2 parents 6d43608 + 63f0ff0 commit 0612137
Showing 1 changed file with 16 additions and 206 deletions.
222 changes: 16 additions & 206 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,125 +1,34 @@
# This is a basic workflow to help you get started with Actions

name: Build and test

on:
push:
branches-ignore:
- 'docs-v*'
pull_request:
branches-ignore:
- 'docs-v*'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test-agent:
# The type of runner that the job will run on
main:
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
submodules: recursive

- uses: oven-sh/setup-bun@v1

- name: System Version Checks
run: |
echo ------------ GIT_CURRENT_BRANCH
export GIT_CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo $GIT_CURRENT_BRANCH
echo ------------ GIT_SYMBOLIC_BRANCH
export GIT_SYMBOLIC_BRANCH=$(git symbolic-ref --short HEAD)
echo $GIT_SYMBOLIC_BRANCH
echo ------------ GITHUB_WORKFLOW
echo $GITHUB_WORKFLOW
echo ------------ GITHUB_RUN_ID
echo $GITHUB_RUN_ID
echo ------------ GITHUB_RUN_NUMBER
echo $GITHUB_RUN_NUMBER
echo ------------ GITHUB_ACTION
echo $GITHUB_ACTION
echo ------------ GITHUB_ACTIONS
echo $GITHUB_ACTIONS
echo ------------ GITHUB_ACTOR
echo $GITHUB_ACTOR
echo ------------ GITHUB_REPOSITORY
echo $GITHUB_REPOSITORY
echo ------------ GITHUB_EVENT_NAME
echo $GITHUB_EVENT_NAME
echo ------------ GITHUB_EVENT_PATH
echo $GITHUB_EVENT_PATH
echo ------------ GITHUB_WORKSPACE
echo $GITHUB_WORKSPACE
echo ------------ GITHUB_SHA
echo $GITHUB_SHA
echo ------------ GITHUB_REF
echo $GITHUB_REF
echo ------------ GITHUB_HEAD_REF
echo $GITHUB_HEAD_REF
echo ------------ GITHUB_BASE_REF
echo $GITHUB_BASE_REF
echo ------------ user
echo $USER
echo ------------ home
echo $HOME
echo ------------ path
echo $PATH
echo ------------ pwd
pwd
echo ------------ unix name - a
uname -a || true
echo ------------ unix name - r
uname -r || true
echo ------------ lsb
lsb_release -a || true
echo ------------ hostnamectl
hostnamectl || true
echo ------------ /etc/os-release
cat /etc/os-release || true
echo ------------ /proc/version
cat /proc/version || true
echo ------------ lscpu
lscpu || true
- name: INIT - install needed utilities
run: |
sudo apt-get install -y jq sed
- name: INIT - install Node JS
uses: actions/setup-node@v4
with:
node-version: 18

- name: INIT - install Node utilities
run: |
npm install --global npx || true
npm install --global yarn
npm install --global node-gyp
- name: INIT - version checks of Node JS and its utilities
run: |
which node
node --version
which npx
npx --version
which npm
npm --version
which yarn
yarn --version
which node-gyp
node-gyp --version
- name: INIT - version checks of Bun SH
run: |
which bun
bun --version
- name: Install ESLINT
- name: Install Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- uses: oven-sh/setup-bun@v1

- name: INIT - install utilities
run: |
sudo npm install -g eslint
sudo apt-get install -y jq sed
npm install -g eslint
eslint --version
- name: Install all NPMs at root
Expand All @@ -136,100 +45,6 @@ jobs:
run: |
yarn run lint-nb
- name: Python Version Checks
run: |
echo ------------ python version check
which python || echo "----> Looks like python was not installed, next command will fail"
python --version
echo ------------ python3 version check
which python3 || echo "----> Looks like python3 was not installed, next command will fail"
python3 --version
- name: Install Python Prerequisites
run: |
echo ------------ py3 installs
sudo apt-get install -y python3-pip python3-setuptools python3-dev
echo ------------ py3 wheel - apt
sudo apt-get install -y python3-wheel
echo ------------ py3 wheel - pip
pip3 install wheel
# echo ------------ slither analyzer install
# #pip3 install slither-analyzer==0.8.3
# pip3 install -r IMA/proxy/scripts/requirements.txt
# echo ------------ slither search attempt
# sudo find / -name slither || true
# echo ------------ slither location detection - after install
# export PATH=$PATH:/home/$USER/.local/bin
# which slither || echo "----> Looks like slither was not installed, next command will fail"
# echo ------------ slither version check - after install
# slither --version || true
test-integration:
runs-on: ubuntu-latest

env:
working-directory: ./test

steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- uses: oven-sh/setup-bun@v1

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: INIT - install Node JS
uses: actions/setup-node@v4
with:
node-version: 18

- name: INIT - install Node utilities
run: |
npm install --global npx || true
npm install --global yarn
npm install --global node-gyp
- name: INIT - version checks of Node JS and its utilities
run: |
which node
node --version
which npx
npx --version
which npm
npm --version
which yarn
yarn --version
which node-gyp
node-gyp --version
- name: INIT - version checks of Bun SH
run: |
which bun
bun --version
- name: Install Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install all NPMs in src
working-directory: ./src
run: |
Expand Down Expand Up @@ -258,6 +73,11 @@ jobs:
echo "Content of \"accounts.json\" is:"
cat ../../test/accounts.json | jq
- name: Run test (JS part)
working-directory: ./test
run: |
yarn test
- name: Prepare test (PY part)
working-directory: ./test
run: |
Expand All @@ -276,13 +96,3 @@ jobs:
export URL_W3_ETHEREUM="http://127.0.0.1:8545"
export URL_W3_S_CHAIN="http://127.0.0.1:8545"
python3 test.py
- name: Prepare test (JS part)
working-directory: ./test
run: |
yarn install
- name: Run test (JS part)
working-directory: ./test
run: |
yarn test

0 comments on commit 0612137

Please sign in to comment.