Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
105 lines (87 loc) · 3.5 KB

File metadata and controls

105 lines (87 loc) · 3.5 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Release
# https://help.github.com/es/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
on:
push:
tags:
- v[0-9].[0-9]+.[0-9]*
permissions:
id-token: write
security-events: write
actions: write
contents: write
pull-requests: read
packages: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Set up Go 1.x
id: go
uses: actions/setup-go@v6
with:
go-version-file: ./go.mod
- name: Summary Information
run: |
echo "# Build Summary" > $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Repository:** ${{ github.repository }}" >> $GITHUB_STEP_SUMMARY
echo "**Who merge:** ${{ github.triggering_actor }}" >> $GITHUB_STEP_SUMMARY
echo "**Commit ID:** ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
echo "**Branch:** ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
- name: Lines of code
env:
GH_TOKEN: ${{ github.token }}
run: |
export TOOL_NAME="scc"
export GIT_ORG="boyter"
export GIT_REPO="scc"
export OS=$(uname -s)
export OS_ARCH=$(uname -m)
# Normalize architecture names to match asset naming
[[ "$OS_ARCH" == "aarch64" ]] && OS_ARCH="arm64"
[[ "$OS_ARCH" == "x86_64" ]] && OS_ARCH="x86_64"
export ASSETS_NAME=$(gh release view --repo ${GIT_ORG}/${GIT_REPO} --json assets -q "[.assets[] | select(.name | contains(\"${TOOL_NAME}\") and contains(\"${OS}\") and contains(\"${OS_ARCH}\"))] | sort_by(.createdAt) | last.name")
gh release download --repo $GIT_ORG/$GIT_REPO --pattern $ASSETS_NAME
# Extract based on file extension
if [[ "$ASSETS_NAME" == *.tar.gz ]]; then
tar -xzf $ASSETS_NAME
elif [[ "$ASSETS_NAME" == *.zip ]]; then
unzip $ASSETS_NAME
fi
rm $ASSETS_NAME
mv $TOOL_NAME ~/go/bin/$TOOL_NAME
~/go/bin/$TOOL_NAME --version
# go install github.com/boyter/scc/v3@latest
scc --format html-table . | tee -a $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
- name: Test
run: |
echo "### Test report" >> $GITHUB_STEP_SUMMARY
go test -race -coverprofile=coverage.txt -covermode=atomic -tags=unit ./... | tee -a $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
- name: Test coverage
run: |
echo "## Test Coverage" >> $GITHUB_STEP_SUMMARY
# Generate coverage report using standard library tools
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Coverage report" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
go tool cover -func=coverage.txt | tee -a $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
# Calculate total coverage percentage
total_coverage=$(go tool cover -func=coverage.txt | grep total | awk '{print $3}')
echo "**Total Coverage:** $total_coverage" >> $GITHUB_STEP_SUMMARY
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
draft: false
prerelease: false
generate_release_notes: true
make_latest: true
Morty Proxy This is a proxified and sanitized view of the page, visit original site.