Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing/cache #28

Closed
wants to merge 16 commits into from
82 changes: 82 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Build
run-name: Build
on:
push:
branches:
- master
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version:
- 3.9.6
- 3.9.8
- 3.9.9
- 3.9.10
- 3.9.11
- 3.9.12
- 3.9.13
- 3.9.16
- 3.10.0
- 3.10.1
- 3.10.2
- 3.10.3
- 3.10.4
- 3.10.10
steps:
- uses: actions/[email protected]
- uses: actions/setup-python@v4
id: cache-deps
with:
python-version: ${{ matrix.python-version }}
cache: 'pipenv'
- run: make setup
- run: make test
- run: make coverage
# docs-build-deploy:
# if: github.ref == 'refs/heads/master'
# runs-on: ubuntu-latest
# container:
# image: python:${{ env.python-version }}
# env:
# PIPENV_VENV_IN_PROJECT: true
# needs: release
# steps:
# - uses: actions/[email protected]
# - run: sudo chown -R circleci:circleci /usr/local/bin
# - name: restore_cache
# uses: actions/[email protected]
# with:
# key: deps9-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
# path: venv
# - run: make setup
# - run: |
# git config --local user.email "[email protected]"
# git config --local user.name "gh-pages deploy bot"
# make gh-pages
# release:
# if: github.ref == 'refs/heads/master'
# needs: test
# runs-on: ubuntu-latest
# container:
# image: python:${{ env.python-version }}
# env:
# PIPENV_VENV_IN_PROJECT: true
# steps:
# - uses: actions/[email protected]
# - name: setup pypi
# run: |-
# echo "[pypi]" >> ~/.pypirc
# echo "username=__token__" >> ~/.pypirc
# echo "password=$PYPI_TOKEN" >> ~/.pypirc
# - name: release
# run: |
# python3 -m pip install --upgrade twine
# make build
# python3 -m twine upload --repository pypi dist/*
# echo "deployed to pypi"
18 changes: 0 additions & 18 deletions .github/workflows/build_workflow.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/update_schema_flow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: lim-deriv/python-deriv-api/update_schema_flow
on:
schedule:
- cron: 0 0 * * *
# # 'filters' was not transformed because there is no suitable equivalent in GitHub Actions
jobs:
update_schema:
runs-on: ubuntu-latest
container:
image: python:${{ env.python-version }}
env:
PIPENV_VENV_IN_PROJECT: true
env:
python-version: 3.9.6
steps:
# Ensure parameter if_key_exists is set correctly
- name: Install SSH key
uses: shimataro/[email protected]
with:
key: "${{ secrets.CIRCLE_CI_SSH_KEY }}"
name: circle_ci_id_rsa
known_hosts: "${{ secrets.CIRCLE_CI_KNOWN_HOSTS }}"
if_key_exists: fail
- uses: actions/[email protected]
- name: config git
run: |-
git config --global user.email "[email protected]"
git config --global user.name "Nobody"
- name: update schema
run: |-
git clone https://github.com/binary-com/deriv-developers-portal.git /tmp/deriv-developers-portal
curl -L https://cpanmin.us | perl - --sudo App::cpanminus
sudo cpanm -n Dir::Self File::Basename JSON::MaybeXS Log::Any Path::Tiny Template Syntax::Keyword::Try
BINARYCOM_API_SCHEMA_PATH=/tmp/deriv-developers-portal/config/v3 perl scripts/regen-py.pl
if [[ $(git diff --shortstat) == ' 2 files changed, 2 insertions(+), 2 deletions(-)' ]]
then
echo 'Schema no change'
exit 0
fi
echo "Schama updated"
pip3 install bump
NEXT_VER=$(bump)
sed -i '/# Changelog/{s/$/\n\n## NEXTVER\n\nSync API/}' CHANGELOG.md
sed -i "s/NEXTVER/$NEXT_VER/g" CHANGELOG.md
git add .
git commit -m 'update schema automatically'
git push origin HEAD:master