Skip to content

Commit

Permalink
Tidy up of github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
howroyd committed Aug 26, 2023
1 parent 57f3ec6 commit 202b073
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 26 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,14 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: "CodeQL Vulnerability Scan"

on:
push:
branches:
- '*'
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
- '*' # Scan all branches upon push
schedule:
- cron: '35 10 * * 6'
- cron: '00 9 * * 0'

jobs:
analyze:
Expand Down Expand Up @@ -53,6 +50,7 @@ jobs:
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
Expand Down
20 changes: 7 additions & 13 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,29 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# It will also use PyInstaller to create a Windows executable and upload it to the GitHub release

name: Upload Python Package
name: Build and Publish

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:

pypi-publish:
runs-on: ubuntu-latest

permissions:
contents: read
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install build PyInstaller wheel
- name: Build package
run: python -m build
- name: Publish package
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ permissions:
contents: read

jobs:
build:

linting:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
with:
Expand All @@ -29,18 +27,37 @@ jobs:
python-version: "3.11"
- name: Install dependencies
run: |
git submodule update --init --recursive
python -m pip install --upgrade pip
pip install flake8
if (Test-Path requirements.txt) {pip install -r requirements.txt}
pip install pytest pytest-cov
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install twitchirc
pytest:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
token: ${{ secrets.REPO_SCOPED_TOKEN }}
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
git submodule update --init --recursive
python -m pip install --upgrade pip
pip install pytest pytest-cov
if (Test-Path requirements.txt) {pip install -r requirements.txt}
- name: Install simonsays
run: |
pip install ./pynput_local
pip install .
- name: Test with pytest
run: |
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# TwitchIRC

[![CodeQL Vulnerabilities](https://github.com/howroyd/twitchirc/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/howroyd/twitchirc/actions/workflows/codeql-analysis.yml)\
[![Linting and Testing](https://github.com/howroyd/twitchirc/actions/workflows/python-app.yml/badge.svg)](https://github.com/howroyd/twitchirc/actions/workflows/python-app.yml)\
[![Upload to PyPi](https://github.com/howroyd/twitchirc/actions/workflows/python-publish.yml/badge.svg)](https://github.com/howroyd/twitchirc/actions/workflows/python-publish.yml)
[![Linting and Testing](https://github.com/howroyd/twitchirc/actions/workflows/python-testing.yml/badge.svg)](https://github.com/howroyd/twitchirc/actions/workflows/python-testing.yml)\
[![Build and Release](https://github.com/howroyd/twitchirc/actions/workflows/python-publish.yml/badge.svg)](https://github.com/howroyd/twitchirc/actions/workflows/python-publish.yml)

This module connects to the Twitch IRC as a basic listener client. It handles the ping pong and initial connection but otherwise does not send anything to Twitch therefore does not appear in the viewer list nor can it post to chat. As such, no oauth is required, it just works out of the box.

Expand Down

0 comments on commit 202b073

Please sign in to comment.