Skip to content

Commit dbffaa1

Browse files
authored
Merge pull request #19 from hackafterdark/develop
Added new tool and more tests
2 parents 4f6b6b4 + d4af23c commit dbffaa1

File tree

10 files changed

+1756
-10
lines changed

10 files changed

+1756
-10
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
- name: Download ast-grep binary for tests
2424
run: |
25-
curl -L -o ast-grep.zip https://github.com/ast-grep/ast-grep/releases/download/0.39.5/app-x86_64-unknown-linux-gnu.zip
25+
curl -L -o ast-grep.zip https://github.com/ast-grep/ast-grep/releases/latest/download/app-x86_64-unknown-linux-gnu.zip
2626
unzip -o ast-grep.zip -d cmd/server/bin/
2727
# Verify ast-grep binary works
2828
if [ -f "cmd/server/bin/ast-grep" ]; then
@@ -86,7 +86,7 @@ jobs:
8686
if: matrix.os != 'windows-latest'
8787
run: |
8888
echo "Matrix values: OS=${{ matrix.os }}, GOOS=${{ matrix.goos }}, GOARCH=${{ matrix.goarch }}, Asset=${{ matrix.ast_grep_asset }}"
89-
AST_GREP_URL="https://github.com/ast-grep/ast-grep/releases/download/0.39.5/${{ matrix.ast_grep_asset }}"
89+
AST_GREP_URL="https://github.com/ast-grep/ast-grep/releases/latest/download/${{ matrix.ast_grep_asset }}"
9090
echo "Download URL: $AST_GREP_URL"
9191
curl -L -o ast-grep.zip "$AST_GREP_URL"
9292
unzip -o ast-grep.zip -d cmd/server/bin/
@@ -102,7 +102,7 @@ jobs:
102102
if: matrix.os == 'windows-latest'
103103
run: |
104104
echo "Matrix values: OS=${{ matrix.os }}, GOOS=${{ matrix.goos }}, GOARCH=${{ matrix.goarch }}, Asset=${{ matrix.ast_grep_asset }}"
105-
$AST_GREP_URL = "https://github.com/ast-grep/ast-grep/releases/download/0.39.5/${{ matrix.ast_grep_asset }}"
105+
$AST_GREP_URL = "https://github.com/ast-grep/ast-grep/releases/latest/download/${{ matrix.ast_grep_asset }}"
106106
Write-Host "Download URL: $AST_GREP_URL"
107107
curl.exe -L -o ast-grep.zip $AST_GREP_URL
108108
# Use PowerShell's built-in extraction instead of 7z

.github/workflows/test.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Run Tests
2+
on:
3+
pull_request:
4+
jobs:
5+
test:
6+
name: Test with Coverage
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Set up Go
10+
uses: actions/setup-go@v5
11+
with:
12+
go-version: '1.24.3'
13+
- name: Check out code
14+
uses: actions/checkout@v4
15+
16+
- name: Download ast-grep binary for tests
17+
run: |
18+
curl -L -o ast-grep.zip https://github.com/ast-grep/ast-grep/releases/latest/download/app-x86_64-unknown-linux-gnu.zip
19+
unzip -o ast-grep.zip -d cmd/server/bin/
20+
# Verify ast-grep binary works
21+
if [ -f "cmd/server/bin/ast-grep" ]; then
22+
./cmd/server/bin/ast-grep --version || (echo "ast-grep binary not working"; exit 1)
23+
fi
24+
rm ast-grep.zip
25+
26+
- name: Install dependencies
27+
run: |
28+
go mod download
29+
30+
- name: Verify build works
31+
run: |
32+
go build ./...
33+
34+
- name: Run Unit tests
35+
run: |
36+
go test -race -covermode atomic -coverprofile=coverage.out -v ./...
37+
38+
- name: Install goveralls
39+
run: go install github.com/mattn/goveralls@latest
40+
41+
- name: Send coverage
42+
env:
43+
COVERALLS_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
44+
run: goveralls -coverprofile=coverage.out -service=github

0 commit comments

Comments
 (0)