Support exchange rate for balances (#99) #188
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
name: Actions | |
on: [push] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: '3.10' | |
- uses: actions/cache@v1 | |
with: | |
path: ~/.venv | |
key: v1-dependencies-{{ hashFiles("setup.cfg") }} | |
restore-keys: v1-dependencies- | |
- name: Install dependencies | |
run: | | |
python3 -m venv venv | |
. venv/bin/activate | |
python3 setup.py install | |
python3 -m pip install -r requirements-tests.txt | |
- name: Check style (Flake 8) | |
run: | | |
. venv/bin/activate | |
flake8 | |
- name: Run tests with coverage | |
run: | | |
. venv/bin/activate | |
coverage run -m pytest -vv --strict | |
- name: Coverage report | |
run: | | |
. venv/bin/activate | |
coverage report | |
coverage xml -o coverage.xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ./coverage.xml | |
release: | |
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/docker' }} | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: '3.10' | |
- uses: actions/cache@v1 | |
with: | |
path: ~/.venv | |
key: v1-dependencies-{{ hashFiles("setup.cfg") }} | |
restore-keys: v1-dependencies- | |
- name: Login to Aliyun Container Registry (ACR) | |
uses: aliyun/acr-login@v1 | |
with: | |
login-server: https://registry-intl.cn-hongkong.aliyuncs.com | |
region-id: cn-hongkong | |
username: "${{ secrets.ACR_USERNAME }}" | |
password: "${{ secrets.ACR_PASSWORD }}" | |
- name: Build Docker image | |
run: bin/docker-build.sh | |
- name: Push Docker image | |
run: bin/docker-push.sh |