Merge "Fixes: 367961263 Add push subscription runbook" #1351
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
pull_request: | |
push: | |
# Declare default permissions as read only. | |
permissions: read-all | |
env: | |
PIPENV_VENV_IN_PROJECT: enabled | |
jobs: | |
make-test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
permissions: | |
contents: read | |
# Required for actions/cache to save and restore caches | |
actions: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 #v4 | |
- name: Set up Python | |
id: setup-python | |
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 #v5 | |
with: | |
python-version: 3.12 | |
- name: Install pipenv | |
run: python -m pip install --upgrade pipenv==2024.4.0 wheel | |
- name: Restore pipenv cache | |
id: cache-pipenv | |
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 #v4 | |
with: | |
path: ./.venv | |
key: test-${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('Pipfile.lock') }} | |
- name: Install dependencies | |
if: steps.cache-pipenv.outputs.cache-hit != 'true' | |
run: pipenv install --deploy --dev | |
- name: Run make test | |
run: pipenv run make test | |
# The gcpdiag.dev website is no longer on github pages, but it's still good to build it in an action to find errors. | |
- name: Hugo build | |
run: | | |
docker run --rm \ | |
--user "$(id -u):$(id -g)" \ | |
-e HUGO_CACHEDIR=/src/.hugo_cache \ | |
-v "${{ github.workspace }}/website:/src" \ | |
-w /src \ | |
us-docker.pkg.dev/gcpdiag-dist/common/gcpdiag-hugo:0.3 \ | |
build |