Skip to content

Commit

Permalink
chore(ci): update to reusing workflow (#212)
Browse files Browse the repository at this point in the history
While at it, do some minor cleanup of some other parts.
  • Loading branch information
TrueBrain authored Jul 28, 2023
1 parent a904ce8 commit 79ada01
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 198 deletions.
7 changes: 3 additions & 4 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
max-line-length = 120
inline-quotes = double

# We use 'black' for coding style; these next two warnings are not PEP-8
# compliant.
# E231 is a bug in 'black', see https://github.com/psf/black/issues/1202
ignore = E203, E231, W503
# Flake8 is not PEP-8 compliant with E203. See:
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8
extend-ignore = E203
89 changes: 0 additions & 89 deletions .github/workflows/deploy-aws.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Preview

on:
pull_request_target:
types:
- labeled
- synchronize
branches:
- main

jobs:
preview:
if: ${{ (github.event.action == 'labeled' && github.event.label.name == 'preview') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'preview')) }}
name: Preview
uses: OpenTTD/actions/.github/workflows/rw-entry-preview-docker-nomad.yml@v4
secrets: inherit
with:
service: dibridge-preview
url: https://dibridge-preview.openttd.org/
28 changes: 6 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,12 @@ on:
push:
branches:
- main
release:
types:
- published

jobs:
publish_image:
name: Publish image
uses: OpenTTD/actions/.github/workflows/publish-image.yml@v3

deploy:
name: Deploy
needs:
- publish_image

uses: ./.github/workflows/deploy-aws.yml
release:
name: Release
uses: OpenTTD/actions/.github/workflows/rw-entry-release-docker-nomad.yml@v4
secrets: inherit
with:
is_staging: ${{ github.ref == 'refs/heads/main' }}
name: Relay
cluster: Relay
digest: ${{ needs.publish_image.outputs.digest }}
version: ${{ needs.publish_image.outputs.version }}
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
service: dibridge-prod
url: https://dibridge.openttd.org/
89 changes: 6 additions & 83 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,86 +9,9 @@ on:
- main

jobs:
codeql:
name: Security and Quality
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: python -m pip install -r requirements.txt
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: python
queries: security-and-quality
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

docker:
name: Docker build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: false
cache-from: type=gha
cache-to: type=gha,mode=max

flake8:
name: Flake8
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Flake8
uses: TrueBrain/actions-flake8@v2
with:
path: dibridge

black:
name: Black
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Set up packages
run: |
python -m pip install --upgrade pip
pip install black
- name: Black
run: |
black -l 120 --check dibridge
check_annotations:
name: Check Annotations
needs:
- docker
- flake8
- black
# not codeql, as that reports its own status

if: always() && github.event_name == 'pull_request'

runs-on: ubuntu-latest

steps:
- name: Check annotations
uses: OpenTTD/actions/annotation-check@v2
testing:
name: Testing
uses: OpenTTD/actions/.github/workflows/rw-entry-testing-docker-py.yml@v4
with:
python-path: dibridge
python-version: 3.8
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# dibridge: an Discord <-> IRC Bridge

[![GitHub License](https://img.shields.io/github/license/OpenTTD/dibridge)](https://github.com/OpenTTD/dibridge/blob/main/LICENSE)

Sometimes you have parts of your community that don't want to leave IRC.
But other parts are active on Discord.
What do you do?
Expand Down

0 comments on commit 79ada01

Please sign in to comment.