Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Commit a65cc03

Browse files
authored
chore: set up CI on v1 branch (#214)
* chore: add basic CI for v1 branch * chore: remove docfx
1 parent ee7d172 commit a65cc03

File tree

5 files changed

+111
-33
lines changed

5 files changed

+111
-33
lines changed

.github/workflows/docs.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
on:
2+
pull_request:
3+
branches:
4+
- v1
5+
name: docs
6+
jobs:
7+
docs:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v3
12+
- name: Setup Python
13+
uses: actions/setup-python@v3
14+
with:
15+
python-version: "3.8"
16+
- name: Install nox
17+
run: |
18+
python -m pip install --upgrade setuptools pip wheel
19+
python -m pip install nox
20+
- name: Run docs
21+
run: |
22+
nox -s docs

.github/workflows/lint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
on:
2+
pull_request:
3+
branches:
4+
- v1
5+
name: lint
6+
jobs:
7+
lint:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v3
12+
- name: Setup Python
13+
uses: actions/setup-python@v3
14+
with:
15+
python-version: "3.8"
16+
- name: Install nox
17+
run: |
18+
python -m pip install --upgrade setuptools pip wheel
19+
python -m pip install nox
20+
- name: Run lint
21+
run: |
22+
nox -s lint
23+
- name: Run lint_setup_py
24+
run: |
25+
nox -s lint_setup_py

.github/workflows/unittest.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
on:
2+
pull_request:
3+
branches:
4+
- v1
5+
name: unittest
6+
jobs:
7+
unit:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python: ['3.6', '3.7', '3.8']
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
- name: Setup Python
16+
uses: actions/setup-python@v3
17+
with:
18+
python-version: ${{ matrix.python }}
19+
- name: Install nox
20+
run: |
21+
python -m pip install --upgrade setuptools pip wheel
22+
python -m pip install nox
23+
- name: Run unit tests
24+
env:
25+
COVERAGE_FILE: .coverage-${{ matrix.python }}
26+
run: |
27+
nox -s unit-${{ matrix.python }}
28+
- name: Upload coverage results
29+
uses: actions/upload-artifact@v3
30+
with:
31+
name: coverage-artifacts
32+
path: .coverage-${{ matrix.python }}
33+
34+
cover:
35+
runs-on: ubuntu-latest
36+
needs:
37+
- unit
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v3
41+
- name: Setup Python
42+
uses: actions/setup-python@v3
43+
with:
44+
python-version: "3.8"
45+
- name: Install coverage
46+
run: |
47+
python -m pip install --upgrade setuptools pip wheel
48+
python -m pip install coverage
49+
- name: Download coverage results
50+
uses: actions/download-artifact@v3
51+
with:
52+
name: coverage-artifacts
53+
path: .coverage-results/
54+
- name: Report coverage results
55+
run: |
56+
coverage combine .coverage-results/.coverage*
57+
coverage report --show-missing --fail-under=70

.kokoro/release.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
#!/bin/bash
17-
1816
set -eo pipefail
1917

2018
# Start the releasetool reporter
@@ -28,7 +26,7 @@ python3 -m pip install --upgrade twine wheel setuptools
2826
export PYTHONUNBUFFERED=1
2927

3028
# Move into the package, build the distribution and upload.
31-
TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google_cloud_pypi_password")
29+
TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-1")
3230
cd github/python-container
3331
python3 setup.py sdist bdist_wheel
34-
twine upload --username gcloudpypi --password "${TWINE_PASSWORD}" dist/*
32+
twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/*

.kokoro/release/common.cfg

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,42 +23,18 @@ env_vars: {
2323
value: "github/python-container/.kokoro/release.sh"
2424
}
2525

26-
# Fetch the token needed for reporting release status to GitHub
27-
before_action {
28-
fetch_keystore {
29-
keystore_resource {
30-
keystore_config_id: 73713
31-
keyname: "yoshi-automation-github-key"
32-
}
33-
}
34-
}
35-
3626
# Fetch PyPI password
3727
before_action {
3828
fetch_keystore {
3929
keystore_resource {
4030
keystore_config_id: 73713
41-
keyname: "google_cloud_pypi_password"
31+
keyname: "google-cloud-pypi-token-keystore-1"
4232
}
4333
}
4434
}
4535

46-
# Fetch magictoken to use with Magic Github Proxy
47-
before_action {
48-
fetch_keystore {
49-
keystore_resource {
50-
keystore_config_id: 73713
51-
keyname: "releasetool-magictoken"
52-
}
53-
}
54-
}
55-
56-
# Fetch api key to use with Magic Github Proxy
57-
before_action {
58-
fetch_keystore {
59-
keystore_resource {
60-
keystore_config_id: 73713
61-
keyname: "magic-github-proxy-api-key"
62-
}
63-
}
36+
# Tokens needed to report release status back to GitHub
37+
env_vars: {
38+
key: "SECRET_MANAGER_KEYS"
39+
value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem"
6440
}

0 commit comments

Comments
 (0)