Enable email notification step by default on Helm #4444
Workflow file for this run
This file contains 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: Linting and Unit/e2e Tests | |
"on": | |
push: | |
branches: | |
- main | |
- dev | |
pull_request: | |
# You can use the merge_group event to trigger your GitHub Actions workflow when | |
# a pull request is added to a merge queue | |
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue#triggering-merge-group-checks-with-github-actions | |
merge_group: | |
concurrency: | |
# Cancel any running workflow for the same branch when new commits are pushed. | |
# We group both by ref_name (available when CI is triggered by a push to a branch/tag) | |
# and head_ref (available when CI is triggered by a PR). | |
group: "${{ github.ref_name }}-${{ github.head_ref }}" | |
cancel-in-progress: true | |
jobs: | |
lint-entire-project: | |
name: "Lint entire project" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11.4" | |
cache: "pip" | |
cache-dependency-path: | | |
engine/requirements.txt | |
engine/requirements-dev.txt | |
# following 2 steps - need to install the frontend dependencies for the eslint/prettier/stylelint steps | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18.16.0 | |
cache: "yarn" | |
cache-dependency-path: grafana-plugin/yarn.lock | |
- name: Use cached frontend dependencies | |
id: cache-frontend-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: grafana-plugin/node_modules | |
key: ${{ runner.os }}-frontend-node-modules-${{ hashFiles('grafana-plugin/yarn.lock') }} | |
- name: Install frontend dependencies | |
if: steps.cache-frontend-dependencies.outputs.cache-hit != 'true' | |
working-directory: grafana-plugin | |
run: yarn install --frozen-lockfile --prefer-offline --network-timeout 500000 | |
- uses: pre-commit/action@v3.0.0 | |
lint-test-and-build-frontend: | |
name: "Lint, test, and build frontend" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18.16.0 | |
cache: "yarn" | |
cache-dependency-path: grafana-plugin/yarn.lock | |
- name: Use cached frontend dependencies | |
id: cache-frontend-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: grafana-plugin/node_modules | |
key: ${{ runner.os }}-frontend-node-modules-${{ hashFiles('grafana-plugin/yarn.lock') }} | |
- name: Install frontend dependencies | |
if: steps.cache-frontend-dependencies.outputs.cache-hit != 'true' | |
working-directory: grafana-plugin | |
run: yarn install --frozen-lockfile --prefer-offline --network-timeout 500000 | |
- name: Build frontend (will run linter and tests) | |
working-directory: grafana-plugin | |
run: yarn build | |
test-technical-documentation: | |
name: "Test technical documentation" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Check out code" | |
uses: "actions/checkout@v3" | |
- name: "Build website" | |
# -e HUGO_REFLINKSERRORLEVEL=ERROR prevents merging broken refs with the downside | |
# that no refs to external content can be used as these refs will not resolve in the | |
# docs-base image. | |
run: > | |
docker run -v ${PWD}/docs/sources:/hugo/content/docs/oncall/latest | |
-e HUGO_REFLINKSERRORLEVEL=ERROR | |
--rm grafana/docs-base:latest /bin/bash | |
-c 'echo -e "---\\nredirectURL: /hugo/content/docs/oncall/latest/\\ntype: redirect\\nversioned: true\\n---\\n" | |
> /hugo/content/docs/oncall/_index.md; make hugo' | |
lint-migrations-backend-mysql-rabbitmq: | |
name: "Lint database migrations" | |
runs-on: ubuntu-latest | |
env: | |
DATABASE_HOST: localhost | |
RABBITMQ_URI: amqp://rabbitmq:rabbitmq@localhost:5672 | |
DJANGO_SETTINGS_MODULE: settings.ci-test | |
SLACK_CLIENT_OAUTH_ID: 1 | |
services: | |
rabbit_test: | |
image: rabbitmq:3.12.0 | |
env: | |
RABBITMQ_DEFAULT_USER: rabbitmq | |
RABBITMQ_DEFAULT_PASS: rabbitmq | |
ports: | |
- 5672:5672 | |
mysql_test: | |
image: mysql:8.0.32 | |
env: | |
MYSQL_DATABASE: oncall_local_dev | |
MYSQL_ROOT_PASSWORD: local_dev_pwd | |
ports: | |
- 3306:3306 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11.4" | |
cache: "pip" | |
cache-dependency-path: | | |
engine/requirements.txt | |
engine/requirements-dev.txt | |
- name: Lint migrations | |
working-directory: engine | |
run: | | |
pip install -r requirements.txt -r requirements-dev.txt | |
python manage.py lintmigrations | |
unit-test-helm-chart: | |
name: "Helm Chart Unit Tests" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: azure/setup-helm@v3 | |
with: | |
version: v3.8.0 | |
- name: Install helm unittest plugin | |
run: helm plugin install https://github.com/helm-unittest/helm-unittest.git --version=v0.3.3 | |
- name: Run tests | |
run: helm unittest ./helm/oncall | |
unit-test-backend-mysql-rabbitmq: | |
name: "Backend Tests: MySQL + RabbitMQ (RBAC enabled: ${{ matrix.rbac_enabled }})" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rbac_enabled: ["True", "False"] | |
env: | |
DJANGO_SETTINGS_MODULE: settings.ci-test | |
DATABASE_HOST: localhost | |
RABBITMQ_URI: amqp://rabbitmq:rabbitmq@localhost:5672 | |
SLACK_CLIENT_OAUTH_ID: 1 | |
ONCALL_TESTING_RBAC_ENABLED: ${{ matrix.rbac_enabled }} | |
services: | |
rabbit_test: | |
image: rabbitmq:3.12.0 | |
env: | |
RABBITMQ_DEFAULT_USER: rabbitmq | |
RABBITMQ_DEFAULT_PASS: rabbitmq | |
ports: | |
- 5672:5672 | |
mysql_test: | |
image: mysql:8.0.32 | |
env: | |
MYSQL_DATABASE: oncall_local_dev | |
MYSQL_ROOT_PASSWORD: local_dev_pwd | |
ports: | |
- 3306:3306 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11.4" | |
cache: "pip" | |
cache-dependency-path: | | |
engine/requirements.txt | |
engine/requirements-dev.txt | |
- name: Unit Test Backend | |
working-directory: engine | |
run: | | |
apt-get update && apt-get install -y netcat-traditional | |
pip install -r requirements.txt -r requirements-dev.txt | |
./wait_for_test_mysql_start.sh && pytest -x | |
unit-test-backend-postgresql-rabbitmq: | |
name: "Backend Tests: PostgreSQL + RabbitMQ (RBAC enabled: ${{ matrix.rbac_enabled }})" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rbac_enabled: ["True", "False"] | |
env: | |
DATABASE_TYPE: postgresql | |
DATABASE_HOST: localhost | |
RABBITMQ_URI: amqp://rabbitmq:rabbitmq@localhost:5672 | |
DJANGO_SETTINGS_MODULE: settings.ci-test | |
SLACK_CLIENT_OAUTH_ID: 1 | |
ONCALL_TESTING_RBAC_ENABLED: ${{ matrix.rbac_enabled }} | |
services: | |
rabbit_test: | |
image: rabbitmq:3.12.0 | |
env: | |
RABBITMQ_DEFAULT_USER: rabbitmq | |
RABBITMQ_DEFAULT_PASS: rabbitmq | |
ports: | |
- 5672:5672 | |
postgresql_test: | |
image: postgres:14.4 | |
env: | |
POSTGRES_DB: oncall_local_dev | |
POSTGRES_PASSWORD: local_dev_pwd | |
ports: | |
- 5432:5432 | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11.4" | |
cache: "pip" | |
cache-dependency-path: | | |
engine/requirements.txt | |
engine/requirements-dev.txt | |
- name: Unit Test Backend | |
working-directory: engine | |
run: | | |
pip install -r requirements.txt -r requirements-dev.txt | |
pytest -x | |
unit-test-backend-sqlite-redis: | |
name: "Backend Tests: SQLite + Redis (RBAC enabled: ${{ matrix.rbac_enabled }})" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rbac_enabled: ["True", "False"] | |
env: | |
DATABASE_TYPE: sqlite3 | |
BROKER_TYPE: redis | |
REDIS_URI: redis://localhost:6379 | |
DJANGO_SETTINGS_MODULE: settings.ci-test | |
SLACK_CLIENT_OAUTH_ID: 1 | |
ONCALL_TESTING_RBAC_ENABLED: ${{ matrix.rbac_enabled }} | |
services: | |
redis_test: | |
image: redis:7.0.5 | |
ports: | |
- 6379:6379 | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11.4" | |
cache: "pip" | |
cache-dependency-path: | | |
engine/requirements.txt | |
engine/requirements-dev.txt | |
- name: Unit Test Backend | |
working-directory: engine | |
run: | | |
apt-get update && apt-get install -y netcat-traditional | |
pip install -r requirements.txt -r requirements-dev.txt | |
pytest -x | |
unit-test-pd-migrator: | |
name: "Unit tests - PagerDuty Migrator" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11.4" | |
cache: "pip" | |
cache-dependency-path: tools/pagerduty-migrator/requirements.txt | |
- name: Unit Test PD Migrator | |
working-directory: tools/pagerduty-migrator | |
run: | | |
pip install -r requirements.txt | |
pytest -x | |
mypy: | |
name: "mypy" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11.4" | |
cache: "pip" | |
cache-dependency-path: | | |
engine/requirements.txt | |
engine/requirements-dev.txt | |
- name: mypy Static Type Checking | |
working-directory: engine | |
run: | | |
pip install -r requirements.txt -r requirements-dev.txt | |
mypy . | |
end-to-end-tests: | |
name: End to end tests | |
uses: ./.github/workflows/e2e-tests.yml | |
with: | |
# NOTE: don't run on > 10.0.3 until this issue is fixed. It appears that something was changed | |
# with the plugin-proxy that caused it to start throwing HTTP 502s from time to time | |
# https://raintank-corp.slack.com/archives/C01C4K8DETW/p1692279329797149 | |
grafana-image-tag: 10.0.2 | |
run-expensive-tests: false | |
secrets: inherit |