Repository navigation
84 lines (81 loc) · 2.43 KB
/
Copy pathpython.yml
File metadata and controls
84 lines (81 loc) · 2.43 KB
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
name: Python package
on:
pull_request:
types:
- opened
- reopened
paths:
- "dbt_serverless/**.py"
- ".github/workflows/python.yml"
- "pyproject.toml"
- "poetry.lock"
- "README.md"
- "LICENSE.txt"
env:
POETRY_VERSION: "1.2.2"
PYTHON_VERSION: "3.10"
jobs:
test:
runs-on: ubuntu-latest
# Add "id-token" with the intended permissions.
permissions:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/checkout@v3
- name: "Create env file"
run: |
echo "${{ secrets.ENV_FILE }}" > .env
- id: "auth"
name: "Authenticate to Google Cloud"
uses: "google-github-actions/auth@v1"
with:
workload_identity_provider: projects/${{ secrets.PROJECT_ID }}/locations/global/workloadIdentityPools/github-pool/providers/github-provider
service_account: github-actions@${{ secrets.PROJECT }}.iam.gserviceaccount.com
- name: Install poetry
run: pipx install poetry==${{ env.POETRY_VERSION }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: |
3.9
3.10
cache: poetry
- name: Test with Nox
run: make test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Create env file"
run: |
echo "${{ secrets.ENV_FILE }}" > .env
- name: Install poetry
run: pipx install poetry==${{ env.POETRY_VERSION }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: poetry
- name: Quality with Nox
run: make quality
# mypy isn't iso results with local development meanwhile version is the same
continue-on-error: true
poetry-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry==${{ env.POETRY_VERSION }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Validate Poetry Configuration and Lockfile Freshness
run: poetry lock --check