Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

permissions:
contents: read

jobs:
build-and-test:
runs-on: ubuntu-latest
Comment on lines +13 to +14
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.

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Racket
uses: Bogdanp/setup-racket@v1.11
with:
architecture: x64
distribution: full
version: stable

- name: Compile
run: |
raco make randstr/main.rkt
raco make randstr/cli/main.rkt
Comment on lines +27 to +30
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.

- name: Run tests
run: |
racket randstr/tests/test.rkt
racket randstr/tests/test-extensions.rkt
Comment on lines +32 to +35
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.
83 changes: 83 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Release

on:
release:
types: [published]

permissions:
contents: write

jobs:
build-executables:
strategy:
matrix:
include:
- os: ubuntu-latest
platform: linux
arch: x64
ext: ""
- os: macos-13
platform: macos
arch: x64
ext: ""
- os: macos-latest
platform: macos
arch: arm64
ext: ""
- os: windows-latest
platform: windows
arch: x64
ext: ".exe"

runs-on: ${{ matrix.os }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Racket
uses: Bogdanp/setup-racket@v1.11
with:
architecture: ${{ matrix.arch }}
distribution: full
version: stable

- name: Compile
run: |
raco make randstr/main.rkt
raco make randstr/cli/main.rkt
Comment on lines +45 to +48
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.

- name: Build executable
run: raco exe -o randstr${{ matrix.ext }} randstr/cli/main.rkt

- name: Create distribution (Unix)
if: matrix.platform != 'windows'
run: raco distribute dist randstr

- name: Create distribution (Windows)
if: matrix.platform == 'windows'
run: raco distribute dist randstr.exe

- name: Archive distribution (Unix)
if: matrix.platform != 'windows'
run: |
cd dist
tar -czvf ../randstr-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz .
Comment on lines +64 to +65
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.

- name: Archive distribution (Windows)
if: matrix.platform == 'windows'
shell: pwsh
run: |
Compress-Archive -Path dist/* -DestinationPath randstr-${{ matrix.platform }}-${{ matrix.arch }}.zip

- name: Upload release asset (Unix)
if: matrix.platform != 'windows'
uses: softprops/action-gh-release@v2
with:
files: randstr-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz

- name: Upload release asset (Windows)
if: matrix.platform == 'windows'
uses: softprops/action-gh-release@v2
with:
files: randstr-${{ matrix.platform }}-${{ matrix.arch }}.zip