2 Commits

Author SHA1 Message Date
57dcb7ccca add test script and ci
Some checks failed
CI / Test (pull_request) Failing after 22s
2025-03-25 21:59:32 +01:00
8e425b4f12 refactor: application structure (#11)
All checks were successful
CD / Test (push) Successful in 23s
CD / Build and push (amd64) (push) Successful in 1m0s
CD / Build and push (arm64) (push) Successful in 1m42s
CD / Create manifest (push) Successful in 20s
Reviewed-on: #11
Co-authored-by: Timo Behrendt <t.behrendt@t00n.de>
Co-committed-by: Timo Behrendt <t.behrendt@t00n.de>
2025-01-08 19:07:16 +01:00
7 changed files with 18 additions and 41 deletions

View File

@@ -1 +1 @@
1.2.10 1.1.42

View File

@@ -9,28 +9,6 @@ env:
DOCKER_REGISTRY: gitea.t000-n.de DOCKER_REGISTRY: gitea.t000-n.de
jobs: jobs:
check-changes:
name: Check changes
runs-on: ubuntu-latest
outputs:
changes: ${{ steps.filter.outputs.code }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get changed files
id: filter
uses: dorny/paths-filter@v3
with:
filters: |
code:
- 'src/**'
- '.bun-version'
- 'package.json'
- 'tsconfig.json'
- 'Dockerfile'
- 'bun.lockb'
test: test:
name: Test name: Test
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -58,20 +36,18 @@ jobs:
arch: [amd64, arm64] arch: [amd64, arm64]
needs: needs:
- test - test
- check-changes
runs-on: runs-on:
- ubuntu-latest - ubuntu-latest
- linux_${{ matrix.arch }} - linux_${{ matrix.arch }}
if: ${{ needs.check-changes.outputs.changes == 'true' }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v2
- name: Login to Registry - name: Login to Registry
uses: docker/login-action@v3 uses: docker/login-action@v2
with: with:
registry: ${{ env.DOCKER_REGISTRY }} registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ secrets.REGISTRY_USER }} username: ${{ secrets.REGISTRY_USER }}
@@ -84,7 +60,7 @@ jobs:
echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
- name: Build and push - name: Build and push
uses: docker/build-push-action@v6 uses: docker/build-push-action@v4
with: with:
context: . context: .
file: ./Dockerfile file: ./Dockerfile
@@ -92,7 +68,7 @@ jobs:
push: true push: true
provenance: false provenance: false
tags: | tags: |
${{ env.DOCKER_REGISTRY }}/t00n/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}-${{ matrix.arch }} ${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}-${{ matrix.arch }}
create_manifest: create_manifest:
name: Create manifest name: Create manifest
@@ -110,7 +86,7 @@ jobs:
echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
- name: Login to Registry - name: Login to Registry
uses: docker/login-action@v3 uses: docker/login-action@v2
with: with:
registry: ${{ env.DOCKER_REGISTRY }} registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ secrets.REGISTRY_USER }} username: ${{ secrets.REGISTRY_USER }}
@@ -118,8 +94,8 @@ jobs:
- name: Create manifest - name: Create manifest
run: | run: |
docker manifest create ${{ env.DOCKER_REGISTRY }}/t00n/${{ steps.meta.outputs.REPO_NAME }}:latest \ docker manifest create ${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:latest \
${{ env.DOCKER_REGISTRY }}/t00n/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}-amd64 \ ${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}-amd64 \
${{ env.DOCKER_REGISTRY }}/t00n/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}-arm64 ${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}-arm64
docker manifest push ${{ env.DOCKER_REGISTRY }}/t00n/${{ steps.meta.outputs.REPO_NAME }}:latest docker manifest push ${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:latest

View File

@@ -23,3 +23,6 @@ jobs:
- name: Run spellcheck - name: Run spellcheck
run: bun run check:spell run: bun run check:spell
- name: Run integration tests
run: bun run test:integration

View File

@@ -1,4 +1,4 @@
FROM oven/bun:1.2.10 AS base FROM oven/bun:1.1.42 AS base
WORKDIR /app WORKDIR /app

BIN
bun.lockb

Binary file not shown.

View File

@@ -3,15 +3,16 @@
"build": "bun build --minify --target bun --outdir dist --sourcemap src/main.ts", "build": "bun build --minify --target bun --outdir dist --sourcemap src/main.ts",
"check:code": "eslint src/ --ext .ts", "check:code": "eslint src/ --ext .ts",
"check:spell": "cspell --config cspell.code.json **/*.ts", "check:spell": "cspell --config cspell.code.json **/*.ts",
"start": "bun run src/main.ts" "start": "bun run src/main.ts",
"test:integration": "bun test ./tests/*"
}, },
"devDependencies": { "devDependencies": {
"@types/ts3-nodejs-library": "^2.0.1", "@types/ts3-nodejs-library": "^2.0.1",
"@typescript-eslint/eslint-plugin": "^5.46.0", "@typescript-eslint/eslint-plugin": "^5.46.0",
"@typescript-eslint/parser": "^5.46.0", "@typescript-eslint/parser": "^5.46.0",
"cspell": "^8.0.0", "cspell": "^6.17.0",
"eslint": "^8.29.0", "eslint": "^8.29.0",
"typescript": "^5.0.0", "typescript": "^4.9.3",
"@types/bun": "latest" "@types/bun": "latest"
}, },
"dependencies": { "dependencies": {

View File

@@ -1,3 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
}