Skip to content

Commit

Permalink
create new container per test
Browse files Browse the repository at this point in the history
  • Loading branch information
komuw committed Jun 24, 2024
1 parent aa89b21 commit b601b7e
Show file tree
Hide file tree
Showing 2 changed files with 170 additions and 132 deletions.
132 changes: 0 additions & 132 deletions .circleci/config.yml

This file was deleted.

170 changes: 170 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
# DOCS:
# 1. https://help.github.com/en/articles/workflow-syntax-for-github-actions

name: wiji ci

on:
pull_request:
push:
branches:
- master

jobs:

check_release_notes:
name: check_release_notes
timeout-minutes: 1
strategy:
matrix:
platform: [ubuntu-22.04]
runs-on: ${{ matrix.platform }}
steps:
# checkout master branch and the current branch so that we are able to do diff operations.
- name: checkout master branch too.
uses: actions/checkout@v4
with:
ref: master
- name: Check out code
uses: actions/checkout@v4

# https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions
- name: check if changes have release notes
if: ${{ github.ref != 'refs/heads/master' }}
env:
GIT_BRANCH: ${{ github.ref }}
GITHUB_HEAD_REF: ${{ github.head_ref }}
GITHUB_BASE_REF: ${{ github.base_ref }}
run: |
printf "GIT_BRANCH: $GIT_BRANCH \n"
printf "GITHUB_HEAD_REF: $GITHUB_HEAD_REF \n"
printf "GITHUB_BASE_REF: $GITHUB_BASE_REF \n"
printf "list git branches: \n"
git branch --list --all
if [[ "$GIT_BRANCH" == "refs/heads/master" ]]
then
printf "\n $GIT_BRANCH branch, ignoring check for relese notes \n"
elif [[ "$GIT_BRANCH" == *"refs/tags/"* ]]
then
printf "\n $GIT_BRANCH branch, ignoring check for relese notes \n"
else
ChangedFiles=`git diff --name-only remotes/origin/master`
echo $ChangedFiles
case "$ChangedFiles" in
*CHANGELOG.*)
printf "\n Thanks, your commits include update to release notes. \n";;
*)
printf "\n You should add release notes to CHANGELOG.md \n" && exit 77;;
esac
fi
run_tests:
name: run_tests
timeout-minutes: 7
strategy:
matrix:
python-version: ["3.11", "3.12"]
platform: [ubuntu-22.04]
runs-on: ${{ matrix.platform }}
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: tests and benchmarks
run: |
ulimit -a
env
set -x
pwd
pip install -e .[dev,test]
find . -name '*.pyc' -delete;find . -name '__pycache__' -delete | xargs echo
# normal coverage
coverage erase
coverage run --omit="*tests*,*cli/test_*,*examples/*,*.virtualenvs/*,*virtualenv/*,*.venv/*,*__init__*" -m unittest discover -v -s .
codecov
coverage report --show-missing --fail-under=70
# branch coverage
coverage erase
coverage run --branch --omit="*tests*,*cli/test_*,*examples/*,*.virtualenvs/*,*virtualenv/*,*.venv/*,*__init__*" -m unittest discover -v -s .
codecov
coverage report --show-missing --fail-under=67
env:
WIJI_DEBUG: '1'
PYTHONASYNCIODEBUG: '1'

run_analysis:
name: run_analysis
timeout-minutes: 8
strategy:
matrix:
python-version: ["3.11"]
platform: [ubuntu-22.04]
runs-on: ${{ matrix.platform }}
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: tests and benchmarks
run: |
ulimit -a
env
set -x
pwd
pip install -e .[dev,test]
find . -name '*.pyc' -delete;find . -name '__pycache__' -delete | xargs echo
python --version
black --line-length=100 --check . || { printf "\\n\\t please use black to format your code."; exit 77; }
flake8 .
pylint --enable=E --disable=W,R,C --unsafe-load-any-extension=y wiji/ cli/ tests/ documentation/
bandit -r --exclude .venv -ll .
mypy --show-column-numbers -p cli -p wiji #--strict
env:
WIJI_DEBUG: '1'
PYTHONASYNCIODEBUG: '1'

run_wiji:
name: run_analysis
timeout-minutes: 8
strategy:
matrix:
python-version: ["3.11"]
platform: [ubuntu-22.04]
runs-on: ${{ matrix.platform }}
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: tests and benchmarks
run: |
ulimit -a
env
set -x
pwd
pip install -e .[dev,test]
find . -name '*.pyc' -delete;find . -name '__pycache__' -delete | xargs echo
wiji-cli --version
wiji-cli --app tests.testdata.cli.my_app.MyAppInstance --dry-run
env:
WIJI_DEBUG: '1'
PYTHONASYNCIODEBUG: '1'

0 comments on commit b601b7e

Please sign in to comment.