From e8ad91c9379308aa159e9310ca42742903cebf4c Mon Sep 17 00:00:00 2001 From: Zapaxe Date: Sat, 25 Jul 2026 21:36:07 +0530 Subject: [PATCH 01/16] Bug Fix: Visit Variable Initializer Expressions During Usage Analysis --- internal/codegen/c/analysis/visit_var.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/codegen/c/analysis/visit_var.go b/internal/codegen/c/analysis/visit_var.go index f36a69f8..d1b29133 100644 --- a/internal/codegen/c/analysis/visit_var.go +++ b/internal/codegen/c/analysis/visit_var.go @@ -4,4 +4,5 @@ import "github.com/azin-lang/Azin/internal/ast" func (a *Analyzer) visitVar(fn string, stmt *ast.VarStmt) { a.registerVariable(fn, stmt.Name.Value) + a.visitExpr(fn, stmt.Value) } From f9ed1ff553c5dc2bc07b8e7a9a145316f1645fb5 Mon Sep 17 00:00:00 2001 From: Zapaxe Date: Sat, 25 Jul 2026 22:11:28 +0530 Subject: [PATCH 02/16] Bug Fix: Fix Workflows --- .github/workflows/build.yml | 89 ----------------------------------- .github/workflows/linux.yml | 45 ++++++++++++++++++ .github/workflows/macos.yml | 45 ++++++++++++++++++ .github/workflows/windows.yml | 54 +++++++++++++++++++++ 4 files changed, 144 insertions(+), 89 deletions(-) delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/linux.yml create mode 100644 .github/workflows/macos.yml create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index ade4d46e..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: CI - -on: - push: - branches: [ main, dev ] - paths-ignore: - - "**.md" - pull_request: - branches: [ main, dev ] - paths-ignore: - - "**.md" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - contents: read - -jobs: - lint: - name: Lint - runs-on: ubuntu-latest - timeout-minutes: 5 - - steps: - - uses: actions/checkout@v7 - - - uses: actions/setup-go@v7 - with: - go-version-file: go.mod - cache: false - - - name: Verify dependencies - run: go mod verify - - - uses: golangci/golangci-lint-action@v9 - with: - version: latest - args: --timeout=5m - - build: - name: Build and test (${{ matrix.os }}) - needs: lint - runs-on: ${{ matrix.os }} - timeout-minutes: 10 - - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] - - env: - BIN_NAME: ${{ runner.os == 'Windows' && 'azc.exe' || 'azc' }} - - defaults: - run: - shell: bash - - steps: - - uses: actions/checkout@v7 - - - uses: actions/setup-go@v7 - with: - go-version-file: go.mod - cache: true - cache-dependency-path: go.sum - - - name: Setup MSVC - if: runner.os == 'Windows' - uses: ilammy/msvc-dev-cmd@v1 - - - name: Download dependencies - run: go mod download - - - name: Build binary - run: go build -v -o "$BIN_NAME" ./cmd/azc - - - name: Run tests - env: - AZC: ${{ github.workspace }}/${{ env.BIN_NAME }} - run: go test -v -race -count=1 -cover ./... - - - name: Upload binary artifact - uses: actions/upload-artifact@v7 - with: - name: azc-${{ runner.os }} - path: ${{ env.BIN_NAME }} - retention-days: 7 \ No newline at end of file diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 00000000..2caff5a5 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,45 @@ +name: Linux + +on: + push: + branches: [ main, dev ] + pull_request: + branches: [ main, dev ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + build: + name: Build and test + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-go@v7 + with: + go-version-file: go.mod + cache: true + cache-dependency-path: go.sum + + - name: Download dependencies + run: go mod download + + - name: Build binary + run: go build -v -o azc ./cmd/azc + + - name: Run tests + run: go test -v -race -count=1 -cover ./... + + - name: Upload binary artifact + uses: actions/upload-artifact@v7 + with: + name: azc-linux + path: azc + retention-days: 7 diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 00000000..3b6bb934 --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,45 @@ +name: macOS + +on: + push: + branches: [ main, dev ] + pull_request: + branches: [ main, dev ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + build: + name: Build and test + runs-on: macos-latest + timeout-minutes: 10 + + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-go@v7 + with: + go-version-file: go.mod + cache: true + cache-dependency-path: go.sum + + - name: Download dependencies + run: go mod download + + - name: Build binary + run: go build -v -o azc ./cmd/azc + + - name: Run tests + run: go test -v -race -count=1 -cover ./... + + - name: Upload binary artifact + uses: actions/upload-artifact@v7 + with: + name: azc-macos + path: azc + retention-days: 7 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 00000000..16bd0887 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,54 @@ +name: Windows + +on: + push: + branches: [ main, dev ] + pull_request: + branches: [ main, dev ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + build: + name: Build and test + runs-on: windows-latest + timeout-minutes: 10 + + defaults: + run: + shell: bash + + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-go@v7 + with: + go-version-file: go.mod + cache: true + cache-dependency-path: go.sum + + - name: Setup MSVC + uses: ilammy/msvc-dev-cmd@v1 + + - name: Download dependencies + run: go mod download + + - name: Build binary + run: go build -v -o azc.exe ./cmd/azc + + - name: Run tests + env: + AZC: ${{ github.workspace }}/azc.exe + run: go test -v -race -count=1 -cover ./... + + - name: Upload binary artifact + uses: actions/upload-artifact@v7 + with: + name: azc-windows + path: azc.exe + retention-days: 7 From b6475a01e001ef3aa75ffa27f8a3ee4915151764 Mon Sep 17 00:00:00 2001 From: Zapaxe Date: Sat, 25 Jul 2026 22:15:57 +0530 Subject: [PATCH 03/16] Improvement: Workflows --- .github/workflows/linux.yml | 46 +++++++++++++++++++++-------------- .github/workflows/macos.yml | 38 +++++++++++++++-------------- .github/workflows/windows.yml | 39 +++++++++++++---------------- 3 files changed, 65 insertions(+), 58 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 2caff5a5..714b3e90 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -3,8 +3,12 @@ name: Linux on: push: branches: [ main, dev ] + paths-ignore: + - '**.md' pull_request: branches: [ main, dev ] + paths-ignore: + - '**.md' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,31 +19,37 @@ permissions: jobs: build: - name: Build and test + name: Go runs-on: ubuntu-latest - timeout-minutes: 10 steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@v4 - - uses: actions/setup-go@v7 + - name: Setup Go + uses: actions/setup-go@v5 with: - go-version-file: go.mod + go-version: 'stable' cache: true - cache-dependency-path: go.sum - - name: Download dependencies - run: go mod download + - name: Install modern GCC + run: | + sudo apt-get update -qq + sudo apt-get install -y -qq software-properties-common + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + sudo apt-get install -y -qq gcc-14 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 - - name: Build binary - run: go build -v -o azc ./cmd/azc + - name: Verify formatting + run: | + test -z "$(gofmt -l .)" - - name: Run tests - run: go test -v -race -count=1 -cover ./... + - name: Run go vet + run: go vet ./... - - name: Upload binary artifact - uses: actions/upload-artifact@v7 - with: - name: azc-linux - path: azc - retention-days: 7 + - name: Build + run: go build -o azc ./cmd/azc + + - name: Full test suite with coverage + env: + AZC: ${{ github.workspace }}/azc + run: go test -count=1 -cover ./... diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 3b6bb934..42242d01 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -3,8 +3,12 @@ name: macOS on: push: branches: [ main, dev ] + paths-ignore: + - '**.md' pull_request: branches: [ main, dev ] + paths-ignore: + - '**.md' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,31 +19,29 @@ permissions: jobs: build: - name: Build and test + name: Go runs-on: macos-latest - timeout-minutes: 10 steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@v4 - - uses: actions/setup-go@v7 + - name: Setup Go + uses: actions/setup-go@v5 with: - go-version-file: go.mod + go-version: 'stable' cache: true - cache-dependency-path: go.sum - - name: Download dependencies - run: go mod download + - name: Verify formatting + run: | + test -z "$(gofmt -l .)" - - name: Build binary - run: go build -v -o azc ./cmd/azc + - name: Run go vet + run: go vet ./... - - name: Run tests - run: go test -v -race -count=1 -cover ./... + - name: Build + run: go build -o azc ./cmd/azc - - name: Upload binary artifact - uses: actions/upload-artifact@v7 - with: - name: azc-macos - path: azc - retention-days: 7 + - name: Full test suite with coverage + env: + AZC: ${{ github.workspace }}/azc + run: go test -count=1 -cover ./... diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 16bd0887..e65a5740 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -3,8 +3,12 @@ name: Windows on: push: branches: [ main, dev ] + paths-ignore: + - '**.md' pull_request: branches: [ main, dev ] + paths-ignore: + - '**.md' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,40 +19,31 @@ permissions: jobs: build: - name: Build and test + name: Go runs-on: windows-latest - timeout-minutes: 10 defaults: run: shell: bash steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@v4 - - uses: actions/setup-go@v7 + - name: Setup Go + uses: actions/setup-go@v5 with: - go-version-file: go.mod + go-version: 'stable' cache: true - cache-dependency-path: go.sum - - name: Setup MSVC - uses: ilammy/msvc-dev-cmd@v1 + - name: Run go vet + run: go vet ./... - - name: Download dependencies - run: go mod download + - name: Build + shell: pwsh + run: go build -o azc.exe ./cmd/azc - - name: Build binary - run: go build -v -o azc.exe ./cmd/azc - - - name: Run tests + - name: Full test suite with coverage + shell: pwsh env: AZC: ${{ github.workspace }}/azc.exe - run: go test -v -race -count=1 -cover ./... - - - name: Upload binary artifact - uses: actions/upload-artifact@v7 - with: - name: azc-windows - path: azc.exe - retention-days: 7 + run: go test -count=1 -cover ./... From af548d44f19227452f7e97021858643d414bb16c Mon Sep 17 00:00:00 2001 From: Zapaxe Date: Sat, 25 Jul 2026 22:19:33 +0530 Subject: [PATCH 04/16] Format: gofmt --- internal/codegen/c/analysis/builtins.go | 47 ++++++++++---------- internal/codegen/c/analysis/builtins_test.go | 6 +-- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/internal/codegen/c/analysis/builtins.go b/internal/codegen/c/analysis/builtins.go index d898fe7f..c52982f7 100644 --- a/internal/codegen/c/analysis/builtins.go +++ b/internal/codegen/c/analysis/builtins.go @@ -31,22 +31,22 @@ var Builtins = map[string]Builtin{ "getchar": {Stdio}, "putchar": {Stdio}, - "malloc": {Stdlib}, - "calloc": {Stdlib}, - "realloc": {Stdlib}, - "free": {Stdlib}, - "exit": {Stdlib}, - "abs" : {Stdlib}, - "atoi" : {Stdlib}, - "atof" : {Stdlib}, - "atol" : {Stdlib}, - "atoll" : {Stdlib}, - "strtol": {Stdlib}, - "strtoll": {Stdlib}, - "strtoul": {Stdlib}, - "strtoull":{Stdlib}, - "strtod": {Stdlib}, - "strtof": {Stdlib}, + "malloc": {Stdlib}, + "calloc": {Stdlib}, + "realloc": {Stdlib}, + "free": {Stdlib}, + "exit": {Stdlib}, + "abs": {Stdlib}, + "atoi": {Stdlib}, + "atof": {Stdlib}, + "atol": {Stdlib}, + "atoll": {Stdlib}, + "strtol": {Stdlib}, + "strtoll": {Stdlib}, + "strtoul": {Stdlib}, + "strtoull": {Stdlib}, + "strtod": {Stdlib}, + "strtof": {Stdlib}, "strlen": {String}, "strcpy": {String}, @@ -64,14 +64,13 @@ var Builtins = map[string]Builtin{ "memmove": {String}, "memcmp": {String}, - "sqrt": {Math}, - "pow": {Math}, - "sin": {Math}, - "cos": {Math}, - "floor": {Math}, - "ceil": {Math}, - "fabs": {Math}, - + "sqrt": {Math}, + "pow": {Math}, + "sin": {Math}, + "cos": {Math}, + "floor": {Math}, + "ceil": {Math}, + "fabs": {Math}, } func LookupBuiltin(name string) (Builtin, bool) { diff --git a/internal/codegen/c/analysis/builtins_test.go b/internal/codegen/c/analysis/builtins_test.go index db99cae1..d26e2e7e 100644 --- a/internal/codegen/c/analysis/builtins_test.go +++ b/internal/codegen/c/analysis/builtins_test.go @@ -21,9 +21,9 @@ func TestLookupBuiltin(t *testing.T) { for _, tt := range tests { result, ok := LookupBuiltin(tt.name) - if (result.Include != tt.exceptedValue || ok != tt.exceptedOk) { - t.Errorf("LookupBuiltin(%q) = (%q, %v); want (%q, %v)", - tt.name, result, ok, tt.exceptedValue, tt.exceptedOk) + if result.Include != tt.exceptedValue || ok != tt.exceptedOk { + t.Errorf("LookupBuiltin(%q) = (%q, %v); want (%q, %v)", + tt.name, result, ok, tt.exceptedValue, tt.exceptedOk) } } } From efd148630258508e88dd641d0aea1b0d6055bf28 Mon Sep 17 00:00:00 2001 From: Zapaxe Date: Sat, 25 Jul 2026 22:46:07 +0530 Subject: [PATCH 05/16] Bug Fix: Windows Workflow --- .github/workflows/windows.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e65a5740..e9722f09 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -35,6 +35,9 @@ jobs: go-version: 'stable' cache: true + - name: Setup MSVC + uses: ilammy/msvc-dev-cmd@v1 + - name: Run go vet run: go vet ./... From af876cd27af5c400a55b059794b030eedc65f8cc Mon Sep 17 00:00:00 2001 From: Zapaxe Date: Sat, 25 Jul 2026 22:51:12 +0530 Subject: [PATCH 06/16] Bug Fix: Stop ClearAll from recursively wiping parent scopes --- internal/optimizer/optimizer.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/internal/optimizer/optimizer.go b/internal/optimizer/optimizer.go index c4759a99..3e40bef5 100644 --- a/internal/optimizer/optimizer.go +++ b/internal/optimizer/optimizer.go @@ -137,12 +137,6 @@ func (s *Scope) Invalidate(name string) { } func (s *Scope) ClearAll() { - // Wipe this scope's known values and stores (e.g. for Loops) s.values = make(map[string]ast.Expr) s.lastStore = make(map[string]ast.Stmt) - - // Recursively wipe parent scopes - if s.parent != nil { - s.parent.ClearAll() - } } From 0b74d3a911334ad0e7f1446cd4ce3f51a1717dee Mon Sep 17 00:00:00 2001 From: Zapaxe Date: Sat, 25 Jul 2026 22:53:53 +0530 Subject: [PATCH 07/16] Bug Fix: Guard Against nil SynType in Parameter Type Resolution --- internal/sema/analyzer.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/sema/analyzer.go b/internal/sema/analyzer.go index 88546819..4a5822b3 100644 --- a/internal/sema/analyzer.go +++ b/internal/sema/analyzer.go @@ -42,7 +42,9 @@ func mangleFunctionName(fn *ast.FuncStmt) string { var name strings.Builder name.WriteString(fn.Name.Value) for _, param := range fn.Params { - name.WriteString("__" + param.SynType.Value) + if param.SynType != nil { + name.WriteString("__" + param.SynType.Value) + } } return name.String() @@ -351,6 +353,9 @@ func (a *Analyzer) registerTopLevelSymbols(program *ast.Program) { }) for _, param := range n.Params { + if param.SynType == nil { + continue + } paramType := a.lookupType(param.SynType.Value) if paramType == nil { a.errorf(param.SynType, "unknown parameter type: %s", param.SynType.Value) From ef6b29b6c3404cddfe029196d36c0441267ac0c1 Mon Sep 17 00:00:00 2001 From: Zapaxe Date: Sat, 25 Jul 2026 22:58:03 +0530 Subject: [PATCH 08/16] Bug Fix: Distinguish Enum From struct in Member-Assignement Type Check --- internal/sema/analyzer.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/sema/analyzer.go b/internal/sema/analyzer.go index 4a5822b3..8313b86b 100644 --- a/internal/sema/analyzer.go +++ b/internal/sema/analyzer.go @@ -640,6 +640,11 @@ func (a *Analyzer) visitStatement(stmt ast.Stmt) { return } + if sym := a.lookup(objectType.Name); sym != nil && sym.Kind == SymbolEnum { + a.errorf(n.Value, "'%s' is an enum and cannot be assigned to", objectType.Name) + return + } + strct := a.lookupStruct(objectType.Name) if strct == nil { a.errorf(n.Value, "'%s' is not a struct", objectType.Name) From 3716c4aaa13badbf78af251f6df6ac6cb6c1a1ee Mon Sep 17 00:00:00 2001 From: Zapaxe Date: Sun, 26 Jul 2026 00:16:51 +0530 Subject: [PATCH 09/16] Improvement: Workflows --- .github/workflows/build.yml | 98 +++++++++++++++++++++++++++++++++++ .github/workflows/linux.yml | 55 -------------------- .github/workflows/macos.yml | 47 ----------------- .github/workflows/windows.yml | 52 ------------------- 4 files changed, 98 insertions(+), 154 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/linux.yml delete mode 100644 .github/workflows/macos.yml delete mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..10366666 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,98 @@ +name: CI + +on: + push: + branches: [ main, dev ] + paths-ignore: + - "**.md" + pull_request: + branches: [ main, dev ] + paths-ignore: + - "**.md" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-go@v7 + with: + go-version-file: go.mod + cache: false + + - name: Verify dependencies + run: go mod verify + + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v9 + with: + version: latest + + build: + name: Build and test (${{ matrix.os }}) + needs: lint + runs-on: ${{ matrix.os }} + timeout-minutes: 10 + + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + + env: + BIN_NAME: ${{ runner.os == 'Windows' && 'azc.exe' || 'azc' }} + + defaults: + run: + shell: bash + + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-go@v7 + with: + go-version-file: go.mod + cache: true + cache-dependency-path: go.sum + + - name: Install modern GCC (Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get update -qq + sudo apt-get install -y -qq software-properties-common + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + sudo apt-get install -y -qq gcc-14 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 + + - name: Setup MSVC (Windows) + if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@v1 + + - name: Download dependencies + run: go mod download + + - name: Build binary + run: go build -v -o "$BIN_NAME" ./cmd/azc + + - name: Run tests + env: + AZC: ${{ github.workspace }}/${{ env.BIN_NAME }} + run: go test -v -count=1 -cover ./... + + - name: Upload binary artifact + uses: actions/upload-artifact@v7 + with: + name: azc-${{ runner.os }} + path: ${{ env.BIN_NAME }} + retention-days: 7 diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml deleted file mode 100644 index 714b3e90..00000000 --- a/.github/workflows/linux.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Linux - -on: - push: - branches: [ main, dev ] - paths-ignore: - - '**.md' - pull_request: - branches: [ main, dev ] - paths-ignore: - - '**.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - contents: read - -jobs: - build: - name: Go - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version: 'stable' - cache: true - - - name: Install modern GCC - run: | - sudo apt-get update -qq - sudo apt-get install -y -qq software-properties-common - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - sudo apt-get install -y -qq gcc-14 - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 - - - name: Verify formatting - run: | - test -z "$(gofmt -l .)" - - - name: Run go vet - run: go vet ./... - - - name: Build - run: go build -o azc ./cmd/azc - - - name: Full test suite with coverage - env: - AZC: ${{ github.workspace }}/azc - run: go test -count=1 -cover ./... diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml deleted file mode 100644 index 42242d01..00000000 --- a/.github/workflows/macos.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: macOS - -on: - push: - branches: [ main, dev ] - paths-ignore: - - '**.md' - pull_request: - branches: [ main, dev ] - paths-ignore: - - '**.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - contents: read - -jobs: - build: - name: Go - runs-on: macos-latest - - steps: - - uses: actions/checkout@v4 - - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version: 'stable' - cache: true - - - name: Verify formatting - run: | - test -z "$(gofmt -l .)" - - - name: Run go vet - run: go vet ./... - - - name: Build - run: go build -o azc ./cmd/azc - - - name: Full test suite with coverage - env: - AZC: ${{ github.workspace }}/azc - run: go test -count=1 -cover ./... diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index e9722f09..00000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Windows - -on: - push: - branches: [ main, dev ] - paths-ignore: - - '**.md' - pull_request: - branches: [ main, dev ] - paths-ignore: - - '**.md' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - contents: read - -jobs: - build: - name: Go - runs-on: windows-latest - - defaults: - run: - shell: bash - - steps: - - uses: actions/checkout@v4 - - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version: 'stable' - cache: true - - - name: Setup MSVC - uses: ilammy/msvc-dev-cmd@v1 - - - name: Run go vet - run: go vet ./... - - - name: Build - shell: pwsh - run: go build -o azc.exe ./cmd/azc - - - name: Full test suite with coverage - shell: pwsh - env: - AZC: ${{ github.workspace }}/azc.exe - run: go test -count=1 -cover ./... From f5b2d80ca5fca019f5f921447c51ba7c83389f54 Mon Sep 17 00:00:00 2001 From: Zapaxe Date: Sun, 26 Jul 2026 00:22:51 +0530 Subject: [PATCH 10/16] Improvement: Update Workflows --- .github/workflows/build.yml | 1 - .github/workflows/deploy-docs.yml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 10366666..6d0288a1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,7 +41,6 @@ jobs: build: name: Build and test (${{ matrix.os }}) - needs: lint runs-on: ${{ matrix.os }} timeout-minutes: 10 diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 79fb63df..5b30c76c 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -63,7 +63,7 @@ jobs: deploy: name: Deploy documentation needs: generate - if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' + if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && secrets.CLOUDFLARE_API_TOKEN != '' runs-on: ubuntu-latest timeout-minutes: 10 From 0517bfd184b9e57187c957672a052db1cedfe198 Mon Sep 17 00:00:00 2001 From: Zapaxe Date: Sun, 26 Jul 2026 00:23:31 +0530 Subject: [PATCH 11/16] Improvement: Golangci-Lint Config Update --- .golangci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 67ebcee2..aa134782 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -24,17 +24,13 @@ linters: # Quality - copyloopvar - - exhaustive - gocheckcompilerdirectives - goconst - gocritic - intrange - - iotamixing - makezero - mirror - misspell - - modernize - - nolintlint - prealloc - predeclared - recvcheck From 4726b83ba6056b871b027467b0fb73b9510d6878 Mon Sep 17 00:00:00 2001 From: Zapaxe Date: Sun, 26 Jul 2026 00:23:53 +0530 Subject: [PATCH 12/16] Bug Fixes --- internal/source/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/source/file.go b/internal/source/file.go index e031a472..5f2ab0ef 100644 --- a/internal/source/file.go +++ b/internal/source/file.go @@ -23,7 +23,7 @@ func New(name string, text []byte) *File { for i, ch := range text { if ch == '\n' { - lines = append(lines, uint32(i+1)) + lines = append(lines, uint32(i+1)) //nolint:gosec } } From e83ff5336e08a585e6c6116520fdb68832cec689 Mon Sep 17 00:00:00 2001 From: Zapaxe Date: Sun, 26 Jul 2026 00:26:05 +0530 Subject: [PATCH 13/16] Bug Fix: Workflows --- .github/workflows/build.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6d0288a1..bff3943b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,7 @@ on: branches: [ main, dev ] paths-ignore: - "**.md" + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -47,10 +48,13 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] - - env: - BIN_NAME: ${{ runner.os == 'Windows' && 'azc.exe' || 'azc' }} + include: + - os: ubuntu-latest + bin: azc + - os: macos-latest + bin: azc + - os: windows-latest + bin: azc.exe defaults: run: @@ -82,16 +86,16 @@ jobs: run: go mod download - name: Build binary - run: go build -v -o "$BIN_NAME" ./cmd/azc + run: go build -v -o "${{ matrix.bin }}" ./cmd/azc - name: Run tests env: - AZC: ${{ github.workspace }}/${{ env.BIN_NAME }} + AZC: ${{ github.workspace }}/${{ matrix.bin }} run: go test -v -count=1 -cover ./... - name: Upload binary artifact uses: actions/upload-artifact@v7 with: - name: azc-${{ runner.os }} - path: ${{ env.BIN_NAME }} + name: azc-${{ matrix.os }} + path: ${{ matrix.bin }} retention-days: 7 From 72961487251078bb502b1049a79b329d6f8f72d2 Mon Sep 17 00:00:00 2001 From: Zapaxe Date: Sun, 26 Jul 2026 00:27:48 +0530 Subject: [PATCH 14/16] Bug Fix: Workflows 2 --- .github/workflows/deploy-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 5b30c76c..b0d828e6 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -2,9 +2,9 @@ name: Deploy API Docs on: push: - branches: [ dev ] + branches: [ main, dev ] pull_request: - branches: [ dev ] + branches: [ main, dev ] workflow_dispatch: concurrency: From 1baa2c30cb3b296669f733a31d9d50fe4de05246 Mon Sep 17 00:00:00 2001 From: Zapaxe Date: Sun, 26 Jul 2026 00:31:36 +0530 Subject: [PATCH 15/16] Bug Fix: Workflows 3 --- .github/workflows/build.yml | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bff3943b..d94884f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,6 +96,39 @@ jobs: - name: Upload binary artifact uses: actions/upload-artifact@v7 with: - name: azc-${{ matrix.os }} + name: azc-${{ runner.os }} path: ${{ matrix.bin }} retention-days: 7 + + docs: + name: Generate documentation + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-go@v7 + with: + go-version-file: go.mod + cache: true + + - name: Download dependencies + run: go mod download + + - name: Install doc2go + run: go install go.abhg.dev/doc2go@latest + + - name: Generate documentation + run: | + $(go env GOPATH)/bin/doc2go \ + -internal \ + -out build/docs/html \ + ./... + + - name: Upload docs artifact + uses: actions/upload-artifact@v7 + with: + name: doc2go-html + path: build/docs/html + retention-days: 7 From 3f171752b60780a8afcf47d62bbd92c466a9b575 Mon Sep 17 00:00:00 2001 From: Zapaxe Date: Sun, 26 Jul 2026 00:35:06 +0530 Subject: [PATCH 16/16] Bug Fix: Workflows 4 --- .github/workflows/build.yml | 35 +------------------------------ .github/workflows/deploy-docs.yml | 2 +- 2 files changed, 2 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d94884f6..bff3943b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,39 +96,6 @@ jobs: - name: Upload binary artifact uses: actions/upload-artifact@v7 with: - name: azc-${{ runner.os }} + name: azc-${{ matrix.os }} path: ${{ matrix.bin }} retention-days: 7 - - docs: - name: Generate documentation - runs-on: ubuntu-latest - timeout-minutes: 10 - - steps: - - uses: actions/checkout@v7 - - - uses: actions/setup-go@v7 - with: - go-version-file: go.mod - cache: true - - - name: Download dependencies - run: go mod download - - - name: Install doc2go - run: go install go.abhg.dev/doc2go@latest - - - name: Generate documentation - run: | - $(go env GOPATH)/bin/doc2go \ - -internal \ - -out build/docs/html \ - ./... - - - name: Upload docs artifact - uses: actions/upload-artifact@v7 - with: - name: doc2go-html - path: build/docs/html - retention-days: 7 diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index b0d828e6..28692170 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -63,7 +63,7 @@ jobs: deploy: name: Deploy documentation needs: generate - if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && secrets.CLOUDFLARE_API_TOKEN != '' + if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest timeout-minutes: 10