debian-koji-osbuild/.github/workflows/ci.yml
Ondřej Budai 72ffb61346 ci: trigger schutzbot from github action
Previously, we had a webhook relay. It received a notification from Github
and sent it to AWS SQS. Now, the webhook is dead. The new method (already used
in osbuild-composer and image-builder) is to send the notification directly
from a github action to AWS SQS.
2021-02-25 14:46:34 +01:00

68 lines
1.7 KiB
YAML

name: Tests
on: [pull_request, push]
jobs:
pylint:
name: Source code linting
runs-on: ubuntu-latest
steps:
- name: "Clone Repository"
uses: actions/checkout@v2
- name: "Run pylint"
uses: osbuild/koji-osbuild/test@main
with:
run: |
pylint plugins/**/*.py test/**/*.py
unit:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: "Clone Repository"
uses: actions/checkout@v2
- name: "Run unit tests"
uses: osbuild/koji-osbuild/test@main
with:
run: |
pytest --cov-report=xml --cov=osbuild test/unit/
- name: Send coverage to codecov.io
run: bash <(curl -s https://codecov.io/bash)
shellcheck:
name: "Shellcheck"
runs-on: ubuntu-latest
steps:
- name: "Clone Repository"
uses: actions/checkout@v2
- name: "Run ShellCheck"
uses: ludeeus/action-shellcheck@0.5.0
with:
severity: warning
codespell:
name: "Spell check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: codespell-project/actions-codespell@master
with:
skip: ./.git,build
schutzbot:
name: "🍌 Trigger Schutzbot"
runs-on: ubuntu-latest
container:
image: docker.io/library/python:3.7
steps:
- uses: actions/checkout@v2
- name: Trigger Schutzbot
env:
EVENT_NAME: ${{ github.event_name }}
WEBHOOK_PAYLOAD: ${{ toJSON(github.event) }}
SQS_REGION: us-east-1
SQS_QUEUE_URL: "https://sqs.us-east-1.amazonaws.com/933752197999/schutzbot_webhook_sqs-staging"
run: |
#!/bin/bash
pip3 install boto3 botocore
schutzbot/send_webhook.py