Skip to content

Commit

Permalink
Breaking: rewrite it in rust (#3)
Browse files Browse the repository at this point in the history
* get started on rust kek

* add async logic for sonarr timers TOKIOOOO

* put an http server in main

* lint

* resolve a warning by moving code i guess

* rename things

* mod files

* reqwest

* add discord models

* add grouping of queue

* start taking in queries

* rename structs and add url and output format queries

* restructured since i realized (again) that sonarr is all this needs to
handle. Also fixed some issues with multiple webhook queues. Also made
the code way more better to read and stuff. Also fixed grouping to be
exactly like the golang version.

* cleanup comments and stuff

* add github workflows and semantic-release

* fix main repo name

* convert dockerfile to rust

* docker image gotta be lowercase i guess

* vscode amirite

* rename dockerfile

* cleanup in dockerfile

* use lint actions gh workflow step

* install the toolchain

* try master branch of workflow step

* fix some clippy warnings

* fix more clippy warnings

* formating

* added a couple basic unit tests cuz i wanted to see what thats like in
rust

* my test script

* reformat for new line lengths
  • Loading branch information
cbackas authored Jul 30, 2023
1 parent 13724ce commit 916faa6
Show file tree
Hide file tree
Showing 21 changed files with 2,689 additions and 389 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Pull Request

on:
pull_request:
branches:
- master

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Run linters
uses: wearerequired/lint-action@master
with:
auto_fix: false
rustfmt: true
clippy: true

test:
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Run Tests
run: |
cargo test --verbose
build:
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Build
run: cargo build --verbose

build_docker:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

# just check that it builds, dont push it anywhere cuz whatever
- name: Build and push
uses: docker/build-push-action@v3
with:
push: false
tags: cbackas/hookbuffer:pr

41 changes: 41 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: SemanticRelease

on:
workflow_dispatch:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Setup Node.js 18
uses: actions/setup-node@v2
with:
node-version: 18

- name: Install Semantic Release
run: npm install semantic-release @codedependant/semantic-release-docker conventional-changelog-eslint

- name: Semantic Release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
DOCKER_REGISTRY_USER: ${{ github.actor }}
DOCKER_REGISTRY_PASSWORD: ${{ secrets.GHCR_TOKEN }}
run: npx semantic-release

- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_ICON: https://avatars.githubusercontent.com/u/9919?s=200&v=4
SLACK_USERNAME: GitHub Actions
SLACK_COLOR: ${{ job.status }}
SLACK_FOOTER: ""
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
*.exe
*.exe

# Added by cargo

/target
Loading

0 comments on commit 916faa6

Please sign in to comment.