Last active
May 13, 2022 13:04
-
-
Save twyle/2369124c962a8135cd00b75ae9da8bcf to your computer and use it in GitHub Desktop.
This file contains hidden or 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: Feature Development Build | |
on: | |
push: | |
branches-ignore: [development, staging, production, release] | |
workflow_dispatch: | |
jobs: | |
Build: | |
runs-on: ubuntu-latest | |
environment: | |
name: Development | |
strategy: | |
matrix: | |
python-version: [3.7, 3.8, 3.9] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Test with pytest | |
run: | | |
if [ -d tests ] || [ -d test ]; then FLASK_APP=${{secrets.FLASK_APP}} FLASK_ENV=${{secrets.FLASK_ENV}} python -m pytest; fi | |
Test: | |
runs-on: ubuntu-latest | |
environment: | |
name: Development | |
needs: [Build] | |
strategy: | |
matrix: | |
python-version: [3.7, 3.8, 3.9] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Test application | |
run: | | |
FLASK_APP=${{secrets.FLASK_APP}} FLASK_ENV=${{secrets.FLASK_ENV}} python manage.py run & | |
sleep 10 | |
curl http://127.0.0.1:5000/api/v1/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment