Skip to content

Add GitHub Actions for CI and Release#2

Merged
hugefiver merged 2 commits intomasterfrom
copilot/add-github-action-compile-test
Dec 19, 2025
Merged

Add GitHub Actions for CI and Release#2
hugefiver merged 2 commits intomasterfrom
copilot/add-github-action-compile-test

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 19, 2025

Adds GitHub Actions for automated CI (compile + test) and release builds that publish standalone executables for mainstream platforms.

CI Workflow (ci.yml)

  • Triggers on push/PR to main/master
  • Compiles with raco make, runs test suite
  • Minimal permissions (contents: read)

Release Workflow (release.yml)

  • Triggers on release publish
  • Matrix build for:
    • Linux x64 (ubuntu-latest)
    • macOS x64 (macos-13)
    • macOS arm64 (macos-latest)
    • Windows x64 (windows-latest)
  • Uses raco distribute for self-contained binaries
  • Uploads .tar.gz (Unix) / .zip (Windows) to release assets via softprops/action-gh-release@v2
Original prompt

增加github action:

  1. 编译,测试
  2. 当publish release时,将cli编译为standalone executable file上传到release上,包括主流的操作系统/架构

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: hugefiver <18693500+hugefiver@users.noreply.github.com>
Copilot AI changed the title [WIP] Add GitHub Action for compilation and testing Add GitHub Actions for CI and Release Dec 19, 2025
Copilot AI requested a review from hugefiver December 19, 2025 15:08
@hugefiver hugefiver marked this pull request as ready for review December 19, 2025 15:13
Copilot AI review requested due to automatic review settings December 19, 2025 15:13
@hugefiver hugefiver merged commit f07b7b4 into master Dec 19, 2025
5 checks passed
@hugefiver hugefiver deleted the copilot/add-github-action-compile-test branch December 19, 2025 15:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds GitHub Actions workflows to automate CI/CD for the randstr project, enabling continuous integration testing and automated release builds across multiple platforms.

Key Changes:

  • Added CI workflow that compiles the project and runs tests on every push/PR to main/master branches
  • Added Release workflow that builds standalone executables for Linux, macOS (x64 and arm64), and Windows when a release is published
  • Both workflows use Racket with the Bogdanp/setup-racket action

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
.github/workflows/ci.yml Defines CI workflow for compilation and testing with minimal permissions
.github/workflows/release.yml Defines release workflow with matrix build strategy for cross-platform executables and automated asset uploads

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml
Comment on lines +32 to +35
- name: Run tests
run: |
racket randstr/tests/test.rkt
racket randstr/tests/test-extensions.rkt
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test suite only runs test.rkt and test-extensions.rkt, but the repository contains additional test files (char-classes-test.rkt, generator-test.rkt, tokenizer-test.rkt, utils-test.rkt, optimization-test.rkt) that are not being executed. Consider either using raco test to discover and run all test files, or explicitly running the additional test files to ensure comprehensive test coverage.

Copilot uses AI. Check for mistakes.
Comment on lines +45 to +48
- name: Compile
run: |
raco make randstr/main.rkt
raco make randstr/cli/main.rkt
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the CI workflow, the compilation step may fail because package dependencies are not installed. Add a step to install package dependencies before compilation, such as raco pkg install --auto --name randstr or raco pkg install --deps search-auto.

Copilot uses AI. Check for mistakes.
Comment on lines +64 to +65
cd dist
tar -czvf ../randstr-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz .
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tar archive is created with . which will include all files and directories in the dist folder without a top-level directory. This means when users extract the archive, files will be extracted directly into their current directory rather than into a subdirectory. Consider creating the archive with a proper top-level directory, for example: tar -czvf ../randstr-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz randstr or renaming the dist directory before archiving.

Suggested change
cd dist
tar -czvf ../randstr-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz .
mv dist randstr-${{ matrix.platform }}-${{ matrix.arch }}
tar -czvf randstr-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz randstr-${{ matrix.platform }}-${{ matrix.arch }}

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
Comment on lines +13 to +14
build-and-test:
runs-on: ubuntu-latest
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI workflow only tests on ubuntu-latest, but the release workflow builds for multiple platforms (Linux, macOS x64, macOS arm64, Windows). Consider adding a matrix strategy to test on multiple operating systems to catch platform-specific issues before release. This is especially important since the release workflow creates executables for Windows and macOS without prior testing on those platforms.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
Comment on lines +27 to +30
- name: Compile
run: |
raco make randstr/main.rkt
raco make randstr/cli/main.rkt
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compilation step may fail because package dependencies defined in info.rkt (like rackunit-lib for tests) are not installed. Consider adding a step to install package dependencies before compilation, for example by running raco pkg install --auto --name randstr or raco pkg install --deps search-auto.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants