3 Commits

Author SHA1 Message Date
kjanat d50a110351 docs: remove emojis from README 2026-06-15 17:13:09 +00:00
kjanat 7933f52003 ci: drop test matrix, run a single Go version from go.mod
The test job ran a 1.24.x/1.25.x matrix, but go.mod requires go 1.25.0, so the
1.24 entry just auto-downloaded the 1.25 toolchain and tested the same thing
twice. Replace the matrix with a single job that sources its Go version from
go.mod via go-version-file, and reference the resolved version through the
setup-go step output in summaries, artifact names, and Codecov flags.
2026-06-15 17:12:19 +00:00
kjanat bf07d6a172 fix(lint): resolve golangci-lint failures and modernize string handling
CI's golangci-lint (v2.12.2) job was failing with 14 issues, which blocked
the dependent test job. This addresses all of them:

- goconst: extract repeated string literals into constants
  - format aliases ("md", "word", "htm") in the exporter factory
  - "section" lesson type shared by markdown and HTML exporters
  - default Articulate Rise base URL and host in the parser
  - reuse existing itemType* constants in the markdown switch
- staticcheck (QF1012): replace buf.WriteString(fmt.Sprintf(...)) with
  fmt.Fprintf(...) in the markdown exporter

Also drop the hardcoded `go: "1.24"` from .golangci.yml so the target Go
version is autodetected from go.mod.
2026-06-15 16:59:06 +00:00
7 changed files with 30 additions and 32 deletions
+13 -23
View File
@@ -46,13 +46,6 @@ jobs:
go-version-file: go.mod
check-latest: true
# Expose the resolved Go version as an env var so it is never
# interpolated directly into a shell script (avoids script injection).
- name: Export Go version
env:
GO_VERSION: ${{ steps.setup-go.outputs.go-version }}
run: echo "GO_VERSION=$GO_VERSION" >> "$GITHUB_ENV"
- name: Install Task
uses: go-task/setup-task@v1
@@ -73,7 +66,7 @@ jobs:
{
cat << EOF
## 🔧 Test Environment
- **Go Version:** $GO_VERSION
- **Go Version:** ${{ steps.setup-go.outputs.go-version }}
- **OS:** ubuntu-latest
- **Timestamp:** $(date -u)
@@ -93,7 +86,7 @@ jobs:
# Generate test summary
{
cat << EOF
## 🧪 Test Results (Go $GO_VERSION)
## 🧪 Test Results (Go ${{ steps.setup-go.outputs.go-version }})
| Metric | Value |
| ----------- | ------------------------------------------------------------- |
@@ -155,7 +148,7 @@ jobs:
{
cat << EOF
## 📊 Code Coverage (Go $GO_VERSION)
## 📊 Code Coverage (Go ${{ steps.setup-go.outputs.go-version }})
**Total Coverage: $COVERAGE**
@@ -214,9 +207,9 @@ jobs:
- name: Upload test artifacts
if: failure()
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@v6
with:
name: test-results-go-${{ env.GO_VERSION }}
name: test-results-go-${{ steps.setup-go.outputs.go-version }}
path: |
test-output.log
coverage/
@@ -226,7 +219,7 @@ jobs:
run: |
{
cat << EOF
## 🔍 Static Analysis (Go $GO_VERSION)
## 🔍 Static Analysis (Go ${{ steps.setup-go.outputs.go-version }})
EOF
@@ -270,10 +263,9 @@ jobs:
- name: Job Summary
if: always()
run: |
{
echo "## 📋 Job Summary (Go $GO_VERSION)"
echo ""
cat << 'EOF'
cat >> "$GITHUB_STEP_SUMMARY" << 'EOF'
## 📋 Job Summary (Go ${{ steps.setup-go.outputs.go-version }})
| Step | Status |
| --------------- | --------------------------------------------------------------- |
| Dependencies | Success |
@@ -283,13 +275,12 @@ jobs:
| Static Analysis | ${{ job.status == 'success' && 'Clean' || 'Issues' }} |
| Code Formatting | ${{ job.status == 'success' && 'Clean' || 'Issues' }} |
EOF
} >> "$GITHUB_STEP_SUMMARY"
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage/coverage.out
flags: Go ${{ env.GO_VERSION }}
flags: Go ${{ steps.setup-go.outputs.go-version }}
slug: kjanat/articulate-parser
token: ${{ secrets.CODECOV_TOKEN }}
@@ -297,7 +288,7 @@ jobs:
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
flags: Go ${{ env.GO_VERSION }}
flags: Go ${{ steps.setup-go.outputs.go-version }}
token: ${{ secrets.CODECOV_TOKEN }}
docker-test:
@@ -353,7 +344,6 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
if: github.event_name == 'pull_request'
steps:
- name: "Checkout Repository"
@@ -381,13 +371,13 @@ jobs:
uses: actions/checkout@v6
- name: Login to Docker Hub
uses: docker/login-action@v4
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
+3 -3
View File
@@ -62,7 +62,7 @@ jobs:
done
- name: Create Release
uses: softprops/action-gh-release@v3
uses: softprops/action-gh-release@v2
with:
files: |
build/articulate-parser-linux-amd64
@@ -91,13 +91,13 @@ jobs:
uses: actions/checkout@v6
- name: Login to Docker Hub
uses: docker/login-action@v4
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
+4
View File
@@ -8,6 +8,10 @@ run:
# Timeout for total work
timeout: 5m
# Skip directories (not allowed in config v2, will use issues exclude instead)
# Go version is autodetected from go.mod
# Include test files
tests: true
+4 -2
View File
@@ -1,6 +1,8 @@
module github.com/kjanat/articulate-parser
go 1.26.0
go 1.25.0
toolchain go1.25.5
require (
github.com/fumiama/go-docx v0.0.0-20250506085032-0c30fd09304b
@@ -10,5 +12,5 @@ require (
require (
github.com/fumiama/imgsz v0.0.4 // indirect
golang.org/x/image v0.42.0 // indirect
golang.org/x/image v0.34.0 // indirect
)
+2 -2
View File
@@ -2,8 +2,8 @@ github.com/fumiama/go-docx v0.0.0-20250506085032-0c30fd09304b h1:/mxSugRc4SgN7Xg
github.com/fumiama/go-docx v0.0.0-20250506085032-0c30fd09304b/go.mod h1:ssRF0IaB1hCcKIObp3FkZOsjTcAHpgii70JelNb4H8M=
github.com/fumiama/imgsz v0.0.4 h1:Lsasu2hdSSFS+vnD+nvR1UkiRMK7hcpyYCC0FzgSMFI=
github.com/fumiama/imgsz v0.0.4/go.mod h1:bISOQVTlw9sRytPwe8ir7tAaEmyz9hSNj9n8mXMBG0E=
golang.org/x/image v0.42.0 h1:1gSs6ehNWXLbkHBIPcWztk3D/6aIA/8hauiAYtlodVY=
golang.org/x/image v0.42.0/go.mod h1:rrpelvGFt+kLPAjPM4HeWPgrl0FtafueU//e5N0qk/Q=
golang.org/x/image v0.34.0 h1:33gCkyw9hmwbZJeZkct8XyR11yH889EQt/QH4VmXMn8=
golang.org/x/image v0.34.0/go.mod h1:2RNFBZRB+vnwwFil8GkMdRvrJOFd1AzdZI6vOY+eJVU=
golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o=
golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec=
golang.org/x/text v0.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE=
Binary file not shown.
+3 -1
View File
@@ -17,8 +17,10 @@ import (
// Default endpoint configuration for the Articulate Rise API.
const (
// Root URL for the Articulate Rise API.
defaultBaseURL = "https://rise.articulate.com"
// Expected host for Articulate Rise share URLs.
riseHost = "rise.articulate.com"
defaultBaseURL = "https://" + riseHost
)
// shareIDRegex is compiled once at package init for extracting share IDs from URIs.