Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
shachlanAmazon committed Aug 2, 2023
1 parent ceb2e5f commit c0ce298
Show file tree
Hide file tree
Showing 6 changed files with 184 additions and 165 deletions.
126 changes: 63 additions & 63 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,75 @@
name: Node
# name: Node

on:
push:
branches: ["main"]
paths:
- babushka-core/**
- submodules/**
- node/**
pull_request:
paths:
- babushka-core/src/**
- submodules/**
- node/**
# on:
# push:
# branches: ["main"]
# paths:
# - babushka-core/**
# - submodules/**
# - node/**
# pull_request:
# paths:
# - babushka-core/src/**
# - submodules/**
# - node/**

env:
CARGO_TERM_COLOR: always
# env:
# CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
redis:
- 7.0.7
# jobs:
# build:
# runs-on: ubuntu-latest
# timeout-minutes: 10
# strategy:
# fail-fast: false
# matrix:
# redis:
# - 7.0.7

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: recursive

- name: Install redis
uses: ./.github/workflows/install-redis
with:
redis-version: ${{ matrix.redis }}
# - name: Install redis
# uses: ./.github/workflows/install-redis
# with:
# redis-version: ${{ matrix.redis }}

- name: Install protoc
run: |
sudo apt update
sudo apt install protobuf-compiler
# - name: Install protoc
# run: |
# sudo apt update
# sudo apt install protobuf-compiler

- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
# - name: Use Node.js 16.x
# uses: actions/setup-node@v3
# with:
# node-version: 16.x

- name: npm install and test
run: |
rm -rf node_modules && npm install --frozen-lockfile
npm install
working-directory: ./node/rust-client
# - name: npm install and test
# run: |
# rm -rf node_modules && npm install --frozen-lockfile
# npm install
# working-directory: ./node/rust-client

- name: build
run: |
rm -rf node_modules && npm install --frozen-lockfile
npm run build
working-directory: ./node
# - name: build
# run: |
# rm -rf node_modules && npm install --frozen-lockfile
# npm run build
# working-directory: ./node

- name: test
run: npm test
working-directory: ./node
# - name: test
# run: npm test
# working-directory: ./node

lint-rust:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
# lint-rust:
# timeout-minutes: 10
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: recursive

- uses: ./.github/workflows/lint-rust
with:
cargo-toml-folder: ./node/rust-client
# - uses: ./.github/workflows/lint-rust
# with:
# cargo-toml-folder: ./node/rust-client
202 changes: 101 additions & 101 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -1,101 +1,101 @@
name: Python tests

on:
push:
branches: ["main"]
paths:
- python/**
- babushka-core/src/**
- submodules/**
pull_request:
paths:
- python/**
- babushka-core/src/**
- submodules/**

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
redis:
- 6.2.4

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

- name: Install redis
uses: ./.github/workflows/install-redis
with:
redis-version: ${{ matrix.redis }}

- name: Install protoc
run: |
sudo apt update
sudo apt install protobuf-compiler
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: Install dependencies
working-directory: ./python
run: |
python -m pip install --upgrade pip
pip install flake8 isort black
- name: Lint with isort
working-directory: ./python
run: |
isort . --profile black --check --diff
- name: Lint with flake8
working-directory: ./python
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --extend-ignore=E230 --exclude=python/pybushka/protobuf,.env/*
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=12 --max-line-length=127 --statistics --extend-ignore=E230 --exclude=python/pybushka/protobuf,.env/*
- name: Lint with black
working-directory: ./python
run: |
black --target-version py36 --check --diff .
- name: Start redis server
working-directory: ./python
run: redis-server &

- name: Generate protobuf files
working-directory: .
run: |
protoc -Iprotobuf=./babushka-core/src/protobuf/ --python_out=./python/python/pybushka ./babushka-core/src/protobuf/*.proto
- name: Test with pytest
working-directory: ./python
run: |
python -m venv .env
source .env/bin/activate
pip install -r requirements.txt
maturin develop --release
pytest --asyncio-mode=auto
lint-rust:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- uses: ./.github/workflows/lint-rust
with:
cargo-toml-folder: ./python
# name: Python tests

# on:
# push:
# branches: ["main"]
# paths:
# - python/**
# - babushka-core/src/**
# - submodules/**
# pull_request:
# paths:
# - python/**
# - babushka-core/src/**
# - submodules/**

# permissions:
# contents: read

# jobs:
# build:
# runs-on: ubuntu-latest
# timeout-minutes: 10
# strategy:
# fail-fast: false
# matrix:
# redis:
# - 6.2.4

# steps:
# - uses: actions/checkout@v3
# with:
# submodules: recursive

# - name: Install redis
# uses: ./.github/workflows/install-redis
# with:
# redis-version: ${{ matrix.redis }}

# - name: Install protoc
# run: |
# sudo apt update
# sudo apt install protobuf-compiler

# - name: Set up Python 3.10
# uses: actions/setup-python@v3
# with:
# python-version: "3.10"

# - name: Install dependencies
# working-directory: ./python
# run: |
# python -m pip install --upgrade pip
# pip install flake8 isort black

# - name: Lint with isort
# working-directory: ./python
# run: |
# isort . --profile black --check --diff

# - name: Lint with flake8
# working-directory: ./python
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --extend-ignore=E230 --exclude=python/pybushka/protobuf,.env/*
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=12 --max-line-length=127 --statistics --extend-ignore=E230 --exclude=python/pybushka/protobuf,.env/*

# - name: Lint with black
# working-directory: ./python
# run: |
# black --target-version py36 --check --diff .

# - name: Start redis server
# working-directory: ./python
# run: redis-server &

# - name: Generate protobuf files
# working-directory: .
# run: |
# protoc -Iprotobuf=./babushka-core/src/protobuf/ --python_out=./python/python/pybushka ./babushka-core/src/protobuf/*.proto

# - name: Test with pytest
# working-directory: ./python
# run: |
# python -m venv .env
# source .env/bin/activate
# pip install -r requirements.txt
# maturin develop --release
# pytest --asyncio-mode=auto

# lint-rust:
# runs-on: ubuntu-latest
# timeout-minutes: 10
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: recursive

# - uses: ./.github/workflows/lint-rust
# with:
# cargo-toml-folder: ./python
Loading

0 comments on commit c0ce298

Please sign in to comment.