mirror of
https://github.com/kjanat/articulate-parser.git
synced 2026-01-16 08:22:09 +01:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 903ee92e4c | |||
|
9c51c0d9e3
|
50
.github/workflows/ci.yml
vendored
50
.github/workflows/ci.yml
vendored
@ -38,19 +38,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: ${{ matrix.go }}
|
go-version: ${{ matrix.go }}
|
||||||
check-latest: true
|
check-latest: true
|
||||||
# Disable built-in cache to use our custom cache
|
|
||||||
cache: false
|
|
||||||
|
|
||||||
- name: Cache Go modules
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cache/go-build
|
|
||||||
~/go/pkg/mod
|
|
||||||
key: ${{ runner.os }}-go-${{ matrix.go }}-${{ hashFiles('**/go.sum', '**/go.mod') }}-v1
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-go-${{ matrix.go }}-
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
- name: Download dependencies with retry
|
- name: Download dependencies with retry
|
||||||
run: |
|
run: |
|
||||||
@ -61,10 +48,10 @@ jobs:
|
|||||||
download_with_retry() {
|
download_with_retry() {
|
||||||
local attempt=1
|
local attempt=1
|
||||||
local max_attempts=3
|
local max_attempts=3
|
||||||
|
|
||||||
while [ $attempt -le $max_attempts ]; do
|
while [ $attempt -le $max_attempts ]; do
|
||||||
echo "Attempt $attempt of $max_attempts"
|
echo "Attempt $attempt of $max_attempts"
|
||||||
|
|
||||||
if go mod download; then
|
if go mod download; then
|
||||||
echo "Download successful on attempt $attempt"
|
echo "Download successful on attempt $attempt"
|
||||||
return 0
|
return 0
|
||||||
@ -79,7 +66,7 @@ jobs:
|
|||||||
attempt=$((attempt + 1))
|
attempt=$((attempt + 1))
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "All download attempts failed"
|
echo "All download attempts failed"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
@ -184,7 +171,7 @@ jobs:
|
|||||||
|
|
||||||
# Create temporary file for package coverage aggregation
|
# Create temporary file for package coverage aggregation
|
||||||
temp_coverage=$(mktemp)
|
temp_coverage=$(mktemp)
|
||||||
|
|
||||||
# Extract package-level coverage data
|
# Extract package-level coverage data
|
||||||
go tool cover -func=coverage.out | grep -v total | while read line; do
|
go tool cover -func=coverage.out | grep -v total | while read line; do
|
||||||
if [[ $line == *".go:"* ]]; then
|
if [[ $line == *".go:"* ]]; then
|
||||||
@ -192,28 +179,28 @@ jobs:
|
|||||||
filepath=$(echo "$line" | awk '{print $1}')
|
filepath=$(echo "$line" | awk '{print $1}')
|
||||||
pkg_path=$(dirname "$filepath" | sed 's|github.com/kjanat/articulate-parser/||' | sed 's|^\./||')
|
pkg_path=$(dirname "$filepath" | sed 's|github.com/kjanat/articulate-parser/||' | sed 's|^\./||')
|
||||||
coverage=$(echo "$line" | awk '{print $3}' | sed 's/%//')
|
coverage=$(echo "$line" | awk '{print $3}' | sed 's/%//')
|
||||||
|
|
||||||
# Use root package if no subdirectory
|
# Use root package if no subdirectory
|
||||||
if [[ "$pkg_path" == "." || "$pkg_path" == "" ]]; then
|
if [[ "$pkg_path" == "." || "$pkg_path" == "" ]]; then
|
||||||
pkg_path="root"
|
pkg_path="root"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$pkg_path $coverage" >> "$temp_coverage"
|
echo "$pkg_path $coverage" >> "$temp_coverage"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Aggregate coverage by package (average)
|
# Aggregate coverage by package (average)
|
||||||
awk '{
|
awk '{
|
||||||
packages[$1] += $2;
|
packages[$1] += $2;
|
||||||
counts[$1]++
|
counts[$1]++
|
||||||
}
|
}
|
||||||
END {
|
END {
|
||||||
for (pkg in packages) {
|
for (pkg in packages) {
|
||||||
avg = packages[pkg] / counts[pkg]
|
avg = packages[pkg] / counts[pkg]
|
||||||
printf "| %s | %.1f%% |\n", pkg, avg
|
printf "| %s | %.1f%% |\n", pkg, avg
|
||||||
}
|
}
|
||||||
}' $temp_coverage | sort >> $GITHUB_STEP_SUMMARY
|
}' $temp_coverage | sort >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
rm -f $temp_coverage
|
rm -f $temp_coverage
|
||||||
|
|
||||||
echo "</details>" >> $GITHUB_STEP_SUMMARY
|
echo "</details>" >> $GITHUB_STEP_SUMMARY
|
||||||
@ -507,8 +494,11 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Login to Docker Hub
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
- name: Log in to GitHub Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
@ -517,11 +507,19 @@ jobs:
|
|||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Extract metadata
|
- name: Extract metadata
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
images: |
|
||||||
|
${{ env.IMAGE_NAME }}
|
||||||
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
tags: |
|
tags: |
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
|
|||||||
@ -9,10 +9,9 @@ A Go-based parser that converts Articulate Rise e-learning content to various fo
|
|||||||
[][MIT License] <!-- [][Commits] -->
|
[][MIT License] <!-- [][Commits] -->
|
||||||
[][Commits]
|
[][Commits]
|
||||||
[][Issues]
|
[][Issues]
|
||||||
[][Build]
|
[][Docker image] <!-- [][Docker image] -->
|
||||||
[][Docker workflow]
|
[][Docker workflow]
|
||||||
[][Docker image]
|
[][Build]
|
||||||
[][Docker image]
|
|
||||||
[][Codecov]
|
[][Codecov]
|
||||||
|
|
||||||
## System Architecture
|
## System Architecture
|
||||||
|
|||||||
@ -5,7 +5,7 @@ package version
|
|||||||
// Version information.
|
// Version information.
|
||||||
var (
|
var (
|
||||||
// Version is the current version of the application.
|
// Version is the current version of the application.
|
||||||
Version = "0.4.0"
|
Version = "0.4.1"
|
||||||
|
|
||||||
// BuildTime is the time the binary was built.
|
// BuildTime is the time the binary was built.
|
||||||
BuildTime = "unknown"
|
BuildTime = "unknown"
|
||||||
|
|||||||
Reference in New Issue
Block a user