-
Notifications
You must be signed in to change notification settings - Fork 4
66 lines (63 loc) · 2.96 KB
/
basic.yml
File metadata and controls
66 lines (63 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: js-sdk-basic
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
ref: development
- uses: nanasess/setup-chromedriver@master
- name: Gathering dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3-pip python3-venv python3-setuptools git tmux redis restic nginx cron wireguard unzip
sudo service redis stop
sudo service nginx stop
sudo pip3 install poetry
sudo poetry run pip3 install pytest parameterized selenium pytest-cov python-telegram-bot
curl -L https://storage.googleapis.com/etcd/v3.4.10/etcd-v3.4.10-linux-amd64.tar.gz -o /tmp/etcd-v3.4.10-linux-amd64.tar.gz
tar xzvf /tmp/etcd-v3.4.10-linux-amd64.tar.gz -C /tmp --strip-components=1
sudo mv /tmp/etcd /usr/local/bin
sudo mv /tmp/etcdctl /usr/local/bin
- name: Install
run: |
sudo poetry install
- name: Run tests
id: tests
continue-on-error: true
env:
TNAME: ${{ secrets.TNAME }}
EMAIL: ${{ secrets.EMAIL }}
WORDS: ${{ secrets.WORDS }}
WALLET_SECRET: ${{ secrets.WALLET_SECRET }}
SOURCE_WALLET_SECRET: ${{ secrets.WALLET_SECRET }}
DESTINATION_WALLET_SECRET: ${{ secrets.DESTINATION_WALLET_SECRET }}
FAKE_EMAIL: ${{ secrets.FAKE_EMAIL }}
FAKE_GITHUB_TOKEN: ${{ secrets.FAKE_GITHUB_TOKEN }}
run: |
sudo --preserve-env=TNAME --preserve-env=EMAIL --preserve-env=WORDS --preserve-env=WALLET_SECRET --preserve-env=SOURCE_WALLET_SECRET \
--preserve-env=DESTINATION_WALLET_SECRET --preserve-env=FAKE_EMAIL --preserve-env=FAKE_GITHUB_TOKEN \
poetry run pytest tests -sv -m "not extend" --cov=jumpscale --cov-report=xml --ignore=tests/clients/digitalocean --ignore=tests/clients/sendgrid
- name: Collect tokens back
env:
WALLET_SECRET: ${{ secrets.WALLET_SECRET }}
DESTINATION_WALLET_SECRET: ${{ secrets.DESTINATION_WALLET_SECRET }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
run: |
sudo --preserve-env=WALLET_SECRET --preserve-env=DESTINATION_WALLET_SECRET --preserve-env=TELEGRAM_BOT_TOKEN --preserve-env=TELEGRAM_CHAT_ID \
poetry run python3 tests/collect_tokens.py
- name: Check tests status
if: steps.tests.outcome != 'success'
run: exit "Tests failed, Please check 'Run tests' step."
- name: Upload coverage to Codecov
if: success()
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}