Mixonomer/.github/workflows/ci.yml
2021-02-07 20:40:59 +00:00

78 lines
2.1 KiB
YAML

name: Tests
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
python-version: [3.8]
poetry-version: [1.1.4]
# node: [ '10', '12', '14' ]
os: [ubuntu-20.04, ubuntu-18.04, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2 # get source
- name: Install Python 3
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry # PYTHON dependency management
uses: abatilo/actions-poetry@v2.1.0
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install Dependencies # PYTHON install dependencies
run: poetry install
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@master
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
- name: Run Tests # test script
run: poetry run python -m unittest discover -s tests
# - name: Setup node # JS setup for testing
# uses: actions/setup-node@v2
# with:
# node-version: ${{ matrix.node }}
# - name: Install Node Packages # JS install
# run: npm ci
deploy:
runs-on: ubuntu-20.04
needs: build
steps:
- uses: actions/checkout@v2 # get source
- name: Install Python 3
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Setup Node # JS setup
uses: actions/setup-node@v2
with:
node-version: 14
- name: Install Node Packages # JS install
run: npm ci
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@master
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
- name: Deploy API to App Engine
run: python admin.py all
- name: Deploy Cron Functions
run: python admin.py all_cron