-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (73 loc) · 2.18 KB
/
pull_request.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Pull Request Events
on: pull_request
permissions:
contents: write
id-token: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
test-unit-python:
name: Unit tests 🐍
runs-on: ubuntu-latest
steps:
- name: ⬇️ Set up code
uses: actions/checkout@v4
with:
show-progress: false
- name: 🐍 Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
cache-dependency-path: ./jobs/setup.py
- name: 📥 Download extra dependencies
run: |
sudo apt-get update
sudo apt-get install -y libkrb5-dev
- name: 🏗 Install module
run: pip install .[tests]
working-directory: ./jobs
- name: 🧪 Run tests
run: pytest
working-directory: ./jobs
test-unit-ui:
name: Unit tests ⎔
runs-on: ubuntu-latest
steps:
- name: ⬇️ Set up code
uses: actions/checkout@v4
- name: ⎔ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: npm
- name: 📥 Download dependencies
run: npm ci
- name: 🧪 Run tests
run: npm test
- name: 🔍 Lint
run: npm run lint
deploy-firebase-preview:
name: Firebase preview
runs-on: ubuntu-latest
needs: [test-unit-ui, test-unit-python]
if: ${{ github.event.sender.type == 'User' && github.head_ref != 'dev' }}
environment:
name: dev
steps:
- name: ⬇️ Set up code
uses: actions/checkout@v4
with:
show-progress: false
- name: 🚀 Deploy Firebase project to preview
uses: ./.github/actions/deploy-firebase
with:
identity_provider: ${{ secrets.IDENTITY_PROVIDER }}
service_account_email: ${{ secrets.SERVICE_ACCOUNT_EMAIL }}
project_id: ${{ secrets.PROJECT_ID }}
firebase_config: ${{ secrets.FIREBASE_CONFIG }}
preview: 'yes'
build_command: npm run build -- --mode dev
repo_token: ${{ secrets.GITHUB_TOKEN }}