Skip to content

Commit

Permalink
Merge pull request #81 from alandtse/online_attributes
Browse files Browse the repository at this point in the history
ci: simplify workflow to use actions
  • Loading branch information
alandtse authored Oct 21, 2021
2 parents 03f9c65 + c087c95 commit 85efbd9
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 22 deletions.
37 changes: 30 additions & 7 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,37 @@ jobs:
steps:
- name: Check out code from GitHub
uses: "actions/checkout@v2"
- name: Setup Python
uses: "actions/setup-python@v1"
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install poetry
run: python3 -m pip install poetry
- name: Install requirements
run: poetry install
python-version: 3.9
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install library
run: poetry install --no-interaction
- name: Run tests
run: |
poetry run pytest \
Expand Down
37 changes: 30 additions & 7 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,37 @@ jobs:
steps:
- name: Check out code from GitHub
uses: "actions/checkout@v2"
- name: Setup Python
uses: "actions/setup-python@v1"
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install poetry
run: python3 -m pip install poetry
- name: Install requirements
run: poetry install
python-version: 3.9
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install library
run: poetry install --no-interaction
- name: Run tests
run: |
poetry run pytest \
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/semantic_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ jobs:
# - name: Move new translations
# run: |
# cp /tmp/lokalise/locale/* /home/runner/work/alexa_media_player/alexa_media_player/custom_components/alexa_media/translations/
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install python-semantic-release
- name: Setup Git
run: |
git config --global user.name "semantic-release"
Expand Down

0 comments on commit 85efbd9

Please sign in to comment.