Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the code #16

Merged
merged 11 commits into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ insert_final_newline = true # Make sure files end with a newline
trim_trailing_whitespace = true # Remove trailing whitespace

# Go files
[*.Go]
[*.go]
max_line_length = 100

# Markdown files
Expand All @@ -25,8 +25,10 @@ trim_trailing_whitespace = false # Don't remove trailing whitespace in Markdown
[*.sh]
indent_size = 2

# YAML files
[*.yaml]
# PowerShell scripts
[*.ps1]
indent_size = 2


# YAML files
[*.{yaml,yml}]
indent_size = 2
72 changes: 33 additions & 39 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,38 @@
name: Linux Build

on:
workflow_dispatch: # Enable manual execution
workflow_dispatch: # Allow manual execution

jobs:
build:
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v4

# Set up Go
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23

# Install dependencies and run the tests
- name: Install Dependencies
run: |
sudo apt-get install -y make
make format
make test
continue-on-error: false

# Build the application
- name: Build for Linux
run: |
make build
continue-on-error: false

# Debug: List Build Directory
- name: List Build Directory
run: ls -R bin

# Upload Build Artifact
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: gogg-linux-amd64
path: 'bin/gogg'
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23

- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y make
make test
continue-on-error: false

- name: Build for Linux
run: |
make build
continue-on-error: false

- name: List Build Directory (for Debugging)
run: ls -R bin

- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: gogg-linux-amd64
path: 'bin/gogg'
Comment on lines +8 to +38

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions Job or Workflow does not set permissions
71 changes: 32 additions & 39 deletions .github/workflows/build_macos.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,37 @@
name: MacOS Build

on:
workflow_dispatch: # Enable manual execution
workflow_dispatch: # Allow manual execution

jobs:
build:
runs-on: macos-latest

steps:
# Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v4

# Set up Go
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23

# Install dependencies and run the tests
- name: Install Dependencies
run: |
brew install make
make format
make test
continue-on-error: false

# Build the application
- name: Build for MacOS
run: |
make build-macos
continue-on-error: false

# Debug: List Build Directory
- name: List Build Directory
run: ls -R bin

# Upload Build Artifact
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: gogg-macos-universal
path: 'bin/gogg'
build:
runs-on: macos-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23

- name: Install Dependencies
run: |
brew install make
make test
continue-on-error: false

- name: Build for MacOS
run: |
make build-macos
continue-on-error: false

- name: List Build Directory (for Debugging)
run: ls -R bin

- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: gogg-macos-universal
path: 'bin/gogg'
Comment on lines +8 to +37

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions Job or Workflow does not set permissions
71 changes: 32 additions & 39 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,37 @@
name: Windows Build

on:
workflow_dispatch: # Enable manual execution
workflow_dispatch: # Allow manual execution

jobs:
build:
runs-on: windows-latest

steps:
# Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v4

# Set up Go
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23

# Install dependencies and run the tests
- name: Install Dependencies
run: |
choco install make -y
make format
make test
continue-on-error: false

# Build the application
- name: Build for Windows
run: |
make build GOGG_BINARY=gogg.exe
continue-on-error: false

# Debug: List Build Directory
- name: List Build Directory
run: ls -R bin

# Upload Build Artifact
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: gogg-windows-amd64
path: 'bin/gogg.exe'
build:
runs-on: windows-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23

- name: Install Dependencies
run: |
choco install make -y
make test
continue-on-error: false

- name: Build for Windows
run: |
make build GOGG_BINARY=gogg.exe
continue-on-error: false

- name: List Build Directory (for Debugging)
run: ls -R bin

- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: gogg-windows-amd64
path: 'bin/gogg.exe'
Comment on lines +8 to +37

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions Job or Workflow does not set permissions
41 changes: 22 additions & 19 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
name: Run Linters

on:
workflow_dispatch: # Allow manual execution
push:
tags:
- 'v*' # Trigger on version tags
workflow_dispatch: # Allow manual execution
push:
tags:
- 'v*' # Trigger on version tags

jobs:
lint:
runs-on: ubuntu-latest
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23

- name: Install golangci-lint
run: |
make install-deps
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y make
make install-deps

- name: Run golangci-lint
run: |
make lint
- name: Run Linters
run: |
make lint
continue-on-error: false
Comment on lines +11 to +31

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions Job or Workflow does not set permissions
Loading
Loading