Skip to content

Merge pull request #146 from TrafficCop/main #527

Merge pull request #146 from TrafficCop/main

Merge pull request #146 from TrafficCop/main #527

Workflow file for this run

name: build
on:
push:
workflow_dispatch:
inputs:
git-ref:
description: Git Ref (Optional)
required: false
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.8"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
ref: "${{ github.event.inputs.git-ref }}"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4.3.0
with:
python-version: ${{ matrix.python-version }}
- name: check git hash
run: git rev-parse HEAD
- name: Test presence of env variables
run: python3 -c "import os; print([x for x in os.environ if 'W' in x])"
env:
WHOOP_4_EMAIL: ${{ secrets.WHOOP_4_EMAIL }}
WHOOP_4_PASSWORD: ${{ secrets.WHOOP_4_PASSWORD }}
- name: check which commit this was
run: git log -1
- name: Install poetry
run: make poetry-download
- name: add poetry to path
run: echo "/Users/runner/.local/bin" >> $GITHUB_PATH
- name: check path
run: echo $PATH; echo $GITHUB_PATH
- name: check poetry
run: poetry --version
- name: Set up cache
uses: actions/cache@v3.0.11
with:
path: .venv
key: venv-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: |
poetry config virtualenvs.in-project true
poetry install
- name: Run style checks
run: |
make check-codestyle
- name: Run tests
run: |
make test
env:
DEXCOM_ACCESS_TOKEN: ${{ secrets.DEXCOM_ACCESS_TOKEN }}
DEXCOM_CLIENT_ID: ${{ secrets.DEXCOM_CLIENT_ID }}
DEXCOM_CLIENT_SECRET: ${{ secrets.DEXCOM_CLIENT_SECRET }}
DEXCOM_EMAIL: ${{ secrets.DEXCOM_EMAIL }}
DEXCOM_PASSWORD: ${{ secrets.DEXCOM_PASSWORD }}
DEXCOM_REFRESH_TOKEN: ${{ secrets.DEXCOM_REFRESH_TOKEN }}
GARMIN_FENIX_7S_EMAIL: ${{ secrets.GARMIN_FENIX_7S_EMAIL }}
GARMIN_FENIX_7S_PASSWORD: ${{ secrets.GARMIN_FENIX_7S_PASSWORD }}
POLAR_EMAIL: ${{ secrets.POLAR_EMAIL }}
POLAR_PASSWORD: ${{ secrets.POLAR_PASSWORD }}
RJCASTE_PAT: ${{ secrets.RJCASTE_PAT }}
TEST_SECRET: ${{ secrets.TEST_SECRET }}
WHOOP_4_EMAIL: ${{ secrets.WHOOP_4_EMAIL }}
WHOOP_4_PASSWORD: ${{ secrets.WHOOP_4_PASSWORD }}
WITHINGS_ACCESS_TOKEN: ${{ secrets.WITHINGS_ACCESS_TOKEN }}
WITHINGS_CLIENT_ID: ${{ secrets.WITHINGS_CLIENT_ID }}
WITHINGS_CLIENT_SECRET: ${{ secrets.WITHINGS_CLIENT_SECRET }}
WITHINGS_EMAIL: ${{ secrets.WITHINGS_EMAIL }}
WITHINGS_REFRESH_TOKEN: ${{ secrets.WITHINGS_REFRESH_TOKEN }}
- name: Push back to github secrets
run: |
echo ${{ secrets.RJCASTE_PAT }} | gh auth login --with-token
gh auth status
python3 set_secrets_script.py