-
Notifications
You must be signed in to change notification settings - Fork 13
issue-98 add test analyzer results to the PR #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,21 +12,21 @@ | |
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| name: go_test | ||
| on: [push, pull_request] | ||
| jobs: | ||
| name: CQL Testing and Analysis | ||
| on: [push, pull_request, workflow_dispatch] | ||
|
|
||
| jobs: | ||
| go_test: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest, macOS-latest, windows-latest] | ||
| steps: | ||
|
|
||
| - name: Set up Go 1.22 | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: 1.22 | ||
| cache: true | ||
| id: go | ||
|
|
||
| - name: Check out code | ||
|
|
@@ -44,28 +44,44 @@ jobs: | |
| go test ./... | ||
|
|
||
| go_spec_test_coverage: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Go 1.22 | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: 1.22 | ||
| id: go | ||
|
|
||
| - name: Check out code | ||
| uses: actions/checkout@v4 | ||
| cache: true | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as the above comment, seems like this is unneeded. |
||
|
|
||
| - name: Get dependencies | ||
| run: | | ||
| go mod download | ||
| - name: Build | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Genuine question, does this work? don't we still need to build everything for the analyzer to be able to run? |
||
| run: | | ||
| go build ./... | ||
| run: go mod download | ||
|
|
||
| - name: Spec Test Coverage | ||
| run: | | ||
| go run tests/spectests/cmd/analyzer/analyzer.go | ||
| - name: Build analyzer | ||
| run: go build -o analyzer tests/spectests/cmd/analyzer/analyzer.go | ||
|
|
||
| - name: Run analyzer | ||
| run: ./analyzer > analyzer-output.txt | ||
|
|
||
| - name: Upload analyzer results | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: analyzer-results | ||
| path: analyzer-output.txt | ||
| if-no-files-found: error | ||
|
|
||
| - name: Comment PR with analyzer results | ||
| if: github.event_name == 'pull_request' | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const fs = require('fs'); | ||
| const analyzerOutput = fs.readFileSync('analyzer-output.txt', 'utf8'); | ||
|
|
||
| github.rest.issues.createComment({ | ||
| issue_number: context.issue.number, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| body: '## CQL Test Analyzer Results\n\n```\n' + analyzerOutput + '\n```' | ||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe from reading https://github.com/actions/setup-go?tab=readme-ov-file that we don't need to explicitly add caching for this action, since as of v4 caching is the default behavior.