Skip to content

chore: Setup emulator testing for Functions integration tests #980

chore: Setup emulator testing for Functions integration tests

chore: Setup emulator testing for Functions integration tests #980

Workflow file for this run

name: Continuous Integration

Check failure on line 1 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

(Line: 46, Col: 5): 'runs-on' is already defined, (Line: 47, Col: 5): 'steps' is already defined
on: pull_request
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ['3.9', '3.10', '3.11', '3.12', '3.13', 'pypy3.9']
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.13 for emulator
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Setup functions emulator environment
run: |
python -m venv integration/emulators/functions/venv
source integration/emulators/functions/venv/bin/activate
pip install -r integration/emulators/functions/requirements.txt
deactivate
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test with pytest
run: pytest
- name: Set up Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install firebase-tools
run: npm install -g firebase-tools
- name: Run Database emulator tests
run: firebase emulators:exec --only database --project fake-project-id 'pytest integration/test_db.py'
- name: Run Functions emulator tests
run: firebase emulators:exec --config integration/emulators/firebase.json --only tasks,functions --project fake-project-id 'CLOUD_TASKS_EMULATOR_HOST=localhost:9499 pytest integration/test_functions.py'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with pylint
run: ./lint.sh all