Cleanup & refactor
Some checks failed
Continous Integration / Build (push) Successful in 11s
Continous Integration / Lint (push) Successful in 9s
Continous Integration / Styling (push) Failing after 3s
Continous Integration / Unit Testing (push) Failing after 30s

This commit is contained in:
marked 2025-05-07 00:37:24 +02:00
parent d3b6212463
commit 2a6907434a
50 changed files with 937 additions and 4110 deletions

98
.forgejo/workflows/ci.yml Normal file
View file

@ -0,0 +1,98 @@
name: Continous Integration
on:
push:
pull_request:
branches:
- main
jobs:
build:
name: Build
runs-on: docker
container:
image: ghcr.io/catthehacker/ubuntu:act-24.04
steps:
- name: Checkout Project
uses: actions/checkout@v4
- name: Install Rokit
uses: https://github.com/CompeyDev/setup-rokit@v0.1.2
with:
token: ${{ secrets.githubtoken }}
- name: Build
run: |
lune run build
- name: Upload Build Artifact
uses: https://git.devmarked.win/actions/upload-artifact@v4
with:
name: build
path: hammer.rbxm
lint:
name: Lint
runs-on: docker
container:
image: ghcr.io/catthehacker/ubuntu:act-24.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Rokit
uses: https://github.com/CompeyDev/setup-rokit@v0.1.2
with:
token: ${{ secrets.githubtoken }}
- name: Lint
run: |
selene lib/
style:
name: Styling
runs-on: docker
container:
image: ghcr.io/catthehacker/ubuntu:act-24.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Check code style
uses: https://github.com/JohnnyMorganz/stylua-action@v4
with:
token: ${{ secrets.githubtoken }}
version: v2.1.0
args: --check lib/
test:
name: Unit Testing
runs-on: docker
container:
image: ghcr.io/catthehacker/ubuntu:act-24.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Luau
uses: https://github.com/EncodedVenom/install-luau@v4
- name: Install Rokit
uses: https://github.com/CompeyDev/setup-rokit@v0.1.2
with:
token: ${{ secrets.githubtoken }}
- name: Install Packages
run: |
pesde install
- name: Run Unit Tests
run: |
output=$(luau test/tests.luau)
echo "$output"
if [[ "$output" == *"0 fails"* ]]; then
echo "Unit Tests Passed"
else
echo "Error: One or More Unit Tests Failed."
exit 1
fi

View file

@ -0,0 +1,82 @@
name: Release
on:
push:
tags: ["v*"]
jobs:
build:
name: Build
runs-on: docker
container:
image: ghcr.io/catthehacker/ubuntu:act-24.04
steps:
- name: Checkout Project
uses: actions/checkout@v4
- name: Install Rokit
uses: https://github.com/CompeyDev/setup-rokit@v0.1.2
with:
token: ${{ secrets.githubtoken }}
- name: Build
run: |
lune run build
- name: Upload Build Artifact
uses: https://git.devmarked.win/actions/upload-artifact@v4
with:
name: build
path: hammer.rbxm
release:
name: Release
needs: [build]
runs-on: docker
container:
image: ghcr.io/catthehacker/ubuntu:act-24.04
permissions:
contents: write
steps:
- name: Checkout Project
uses: actions/checkout@v4
- name: Download Build
uses: https://git.devmarked.win/actions/download-artifact@v4
with:
name: build
path: build
- name: Create Release
uses: actions/forgejo-release@v2
with:
direction: upload
title: Hammer ${{ github.ref_name }}
release-dir: build
publish:
name: Publish
needs: [release]
runs-on: docker
container:
image: ghcr.io/catthehacker/ubuntu:act-24.04
steps:
- name: Checkout Project
uses: actions/checkout@v4
- name: Install Rokit
uses: https://github.com/CompeyDev/setup-rokit@v0.1.2
with:
token: ${{ secrets.githubtoken }}
- name: Wally Login
run: wally login --token ${{ secrets.WALLY_AUTH_TOKEN }}
- name: Wally Publish
run: wally publish
- name: Pesde Login
run: pesde auth login --token "${{ secrets.PESDE_AUTH_TOKEN }}"
- name: Pesde Publish
run: pesde publish -y