Conversation
Co-authored-by: hugefiver <18693500+hugefiver@users.noreply.github.com>
There was a problem hiding this comment.
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.
| - name: Run tests | ||
| run: | | ||
| racket randstr/tests/test.rkt | ||
| racket randstr/tests/test-extensions.rkt |
There was a problem hiding this comment.
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.
| - name: Compile | ||
| run: | | ||
| raco make randstr/main.rkt | ||
| raco make randstr/cli/main.rkt |
There was a problem hiding this comment.
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.
| cd dist | ||
| tar -czvf ../randstr-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz . |
There was a problem hiding this comment.
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.
| 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 }} |
| build-and-test: | ||
| runs-on: ubuntu-latest |
There was a problem hiding this comment.
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.
| - name: Compile | ||
| run: | | ||
| raco make randstr/main.rkt | ||
| raco make randstr/cli/main.rkt |
There was a problem hiding this comment.
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.
Adds GitHub Actions for automated CI (compile + test) and release builds that publish standalone executables for mainstream platforms.
CI Workflow (
ci.yml)raco make, runs test suitecontents: read)Release Workflow (
release.yml)raco distributefor self-contained binaries.tar.gz(Unix) /.zip(Windows) to release assets viasoftprops/action-gh-release@v2Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.