Skip to content

Commit f029f8b

Browse files
committed
chore: restore tests.yaml
1 parent e23ba5e commit f029f8b

File tree

1 file changed

+113
-1
lines changed

1 file changed

+113
-1
lines changed

.github/workflows/tests.yml

Lines changed: 113 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,110 @@ on:
2525
permissions: read-all
2626

2727
jobs:
28+
integration:
29+
name: integration tests
30+
# run integration tests on all builds except pull requests from forks or dependabot
31+
if: |
32+
github.event_name != 'pull_request' ||
33+
(github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')
34+
runs-on: ${{ matrix.os }}
35+
strategy:
36+
matrix:
37+
os: [macos-latest, windows-latest, ubuntu-latest]
38+
python-version: ["3.9", "3.13"]
39+
fail-fast: false
40+
permissions:
41+
contents: read
42+
id-token: write
43+
issues: write
44+
pull-requests: write
45+
steps:
46+
- name: Checkout code
47+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
48+
49+
- name: Setup Python ${{ matrix.python-version }}
50+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
51+
with:
52+
python-version: ${{ matrix.python-version }}
53+
54+
- name: Install nox
55+
run: pip install nox
56+
57+
- id: auth
58+
name: Authenticate to Google Cloud
59+
uses: google-github-actions/auth@71f986410dfbc7added4569d411d040a91dc6935 # v2.1.8
60+
with:
61+
workload_identity_provider: ${{ vars.PROVIDER_NAME }}
62+
service_account: ${{ vars.SERVICE_ACCOUNT }}
63+
access_token_lifetime: 600s
64+
65+
- id: secrets
66+
name: Get secrets
67+
uses: google-github-actions/get-secretmanager-secrets@a8440875e1c2892062aef9061228d4f1af8f919b # v2.2.3
68+
with:
69+
secrets: |-
70+
MYSQL_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_CONNECTION_NAME
71+
MYSQL_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_USER
72+
MYSQL_IAM_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_USER_IAM_PYTHON
73+
MYSQL_PASS:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_PASS
74+
MYSQL_DB:${{ vars.GOOGLE_CLOUD_PROJECT }}/MYSQL_DB
75+
POSTGRES_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_CONNECTION_NAME
76+
POSTGRES_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_USER
77+
POSTGRES_IAM_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_USER_IAM_PYTHON
78+
POSTGRES_PASS:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_PASS
79+
POSTGRES_DB:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_DB
80+
POSTGRES_CAS_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_CAS_CONNECTION_NAME
81+
POSTGRES_CAS_PASS:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_CAS_PASS
82+
POSTGRES_CUSTOMER_CAS_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_CUSTOMER_CAS_CONNECTION_NAME
83+
POSTGRES_CUSTOMER_CAS_PASS:${{ vars.GOOGLE_CLOUD_PROJECT }}/POSTGRES_CUSTOMER_CAS_PASS
84+
SQLSERVER_CONNECTION_NAME:${{ vars.GOOGLE_CLOUD_PROJECT }}/SQLSERVER_CONNECTION_NAME
85+
SQLSERVER_USER:${{ vars.GOOGLE_CLOUD_PROJECT }}/SQLSERVER_USER
86+
SQLSERVER_PASS:${{ vars.GOOGLE_CLOUD_PROJECT }}/SQLSERVER_PASS
87+
SQLSERVER_DB:${{ vars.GOOGLE_CLOUD_PROJECT }}/SQLSERVER_DB
88+
89+
- name: Run tests
90+
env:
91+
MYSQL_CONNECTION_NAME: "${{ steps.secrets.outputs.MYSQL_CONNECTION_NAME }}"
92+
MYSQL_USER: "${{ steps.secrets.outputs.MYSQL_USER }}"
93+
MYSQL_IAM_USER: "${{ steps.secrets.outputs.MYSQL_IAM_USER }}"
94+
MYSQL_PASS: "${{ steps.secrets.outputs.MYSQL_PASS }}"
95+
MYSQL_DB: "${{ steps.secrets.outputs.MYSQL_DB }}"
96+
POSTGRES_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_CONNECTION_NAME }}"
97+
POSTGRES_USER: "${{ steps.secrets.outputs.POSTGRES_USER }}"
98+
POSTGRES_IAM_USER: "${{ steps.secrets.outputs.POSTGRES_IAM_USER }}"
99+
POSTGRES_PASS: "${{ steps.secrets.outputs.POSTGRES_PASS }}"
100+
POSTGRES_DB: "${{ steps.secrets.outputs.POSTGRES_DB }}"
101+
POSTGRES_CAS_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_CAS_CONNECTION_NAME }}"
102+
POSTGRES_CAS_PASS: "${{ steps.secrets.outputs.POSTGRES_CAS_PASS }}"
103+
POSTGRES_CUSTOMER_CAS_CONNECTION_NAME: "${{ steps.secrets.outputs.POSTGRES_CUSTOMER_CAS_CONNECTION_NAME }}"
104+
POSTGRES_CUSTOMER_CAS_PASS: "${{ steps.secrets.outputs.POSTGRES_CUSTOMER_CAS_PASS }}"
105+
SQLSERVER_CONNECTION_NAME: "${{ steps.secrets.outputs.SQLSERVER_CONNECTION_NAME }}"
106+
SQLSERVER_USER: "${{ steps.secrets.outputs.SQLSERVER_USER }}"
107+
SQLSERVER_PASS: "${{ steps.secrets.outputs.SQLSERVER_PASS }}"
108+
SQLSERVER_DB: "${{ steps.secrets.outputs.SQLSERVER_DB }}"
109+
run: nox -s system-${{ matrix.python-version }}
110+
111+
- name: FlakyBot (Linux)
112+
# only run flakybot on periodic (schedule) and continuous (push) events
113+
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'Linux' && always() }}
114+
run: |
115+
curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot -o flakybot -s -L
116+
chmod +x ./flakybot
117+
./flakybot --repo ${{github.repository}} --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
118+
- name: FlakyBot (Windows)
119+
# only run flakybot on periodic (schedule) and continuous (push) events
120+
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'Windows' && always() }}
121+
run: |
122+
curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot.exe -o flakybot.exe -s -L
123+
./flakybot.exe --repo ${{github.repository}} --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
124+
- name: FlakyBot (macOS)
125+
# only run flakybot on periodic (schedule) and continuous (push) events
126+
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'macOS' && always() }}
127+
run: |
128+
curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot-darwin-amd64 -o flakybot -s -L
129+
chmod +x ./flakybot
130+
./flakybot --repo ${{github.repository}} --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
131+
28132
unit:
29133
name: unit tests
30134
runs-on: ubuntu-latest
@@ -60,4 +164,12 @@ jobs:
60164
access_token_lifetime: 600s
61165

62166
- name: Run tests
63-
run: nox -s unit-${{ matrix.python-version }}
167+
run: nox -s unit-${{ matrix.python-version }}
168+
169+
- name: FlakyBot (Linux)
170+
# only run flakybot on periodic (schedule) and continuous (push) events
171+
if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'Linux' && always() }}
172+
run: |
173+
curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot -o flakybot -s -L
174+
chmod +x ./flakybot
175+
./flakybot --repo ${{github.repository}} --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}

0 commit comments

Comments
 (0)