Skip to content

Pin GitHub Actions to full-length commit SHAs #99

Pin GitHub Actions to full-length commit SHAs

Pin GitHub Actions to full-length commit SHAs #99

name: Test Application
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
env:
PORT: 8000
steps:
- name: Checkout code
uses: actions/checkout@0717577d45739eb3c851188b29f50ed6c0b2194e # v2.8.0
- name: Set up Python
uses: actions/setup-python@e9aba2c848f5ebd159c070c61ea2c4e2b122355e # v2.3.4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Start the app
run: uvicorn main:app --host 0.0.0.0 --port ${{ env.PORT }} &
- name: Sleep for 1 minute
run: sleep 60
- name: Stop the app
run: pkill -f 'uvicorn main:app'