-
Notifications
You must be signed in to change notification settings - Fork 5
feat: Use Nix & Shipfox & Just for DevXP #77
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
45dacf4
feat: add Nix flake for Go 1.23 development environment
flemzord a1c0f96
feat: add .envrc and Justfile for environment setup; remove obsolete …
flemzord d9d5d18
feat: add antlr to Nix flake dependencies
flemzord 770c52c
chore: update ANTLR version in generated files to 4.13.2
flemzord a85fda5
feat: add GitHub Actions for environment setup and release management…
flemzord a1e4030
chore: remove SPEAKEASY_API_KEY from workflows to streamline environm…
flemzord 9787678
refactor: simplify range checks in hover functions and update variabl…
flemzord 5638c3a
refactor: improve error handling and logging across multiple files
flemzord 9234cac
feat: Update flake.nix
flemzord File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| use flake --impure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| name: Setup Env | ||
| description: Setup Env for Linux x64 | ||
| inputs: | ||
| token: | ||
| description: 'A Github PAT' | ||
| required: true | ||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Install Nix | ||
| uses: cachix/install-nix-action@v31 | ||
| - name: Cache dependencies | ||
| uses: nix-community/cache-nix-action@v6 | ||
| with: | ||
| primary-key: nix-${{ runner.os }}-${{ hashFiles('**/flake.nix', '**/flake.lock') }} | ||
| restore-prefixes-first-match: nix-${{ runner.os }}- | ||
| - name: Load dependencies | ||
| shell: bash | ||
| run: nix develop --install | ||
| - uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.cache/go-build | ||
| /tmp/go/pkg/mod/ | ||
| key: ${{ runner.os }}-${{ github.job }}-go-${{ hashFiles('**/go.sum') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-${{ github.job }}-go- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| name: Setup Env | ||
| description: Setup Env for Linux x64 | ||
| inputs: | ||
| token: | ||
| description: 'A Github PAT' | ||
| required: true | ||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
| - name: "Put back the git branch into git (Earthly uses it for tagging)" | ||
| shell: bash | ||
| run: | | ||
| branch="" | ||
| if [ -n "$GITHUB_HEAD_REF" ]; then | ||
| branch="$GITHUB_HEAD_REF" | ||
| else | ||
| branch="${GITHUB_REF##*/}" | ||
| fi | ||
| git checkout -b "$branch" || true | ||
|
|
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| name: Default | ||
| on: | ||
| merge_group: | ||
| push: | ||
| branches: | ||
| - main | ||
| - release/* | ||
| pull_request: | ||
| types: [ assigned, opened, synchronize, reopened, labeled ] | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| PR: | ||
| if: github.event_name == 'pull_request' | ||
| name: Check PR Title | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| statuses: write | ||
| steps: | ||
| - uses: amannn/action-semantic-pull-request@v5 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| Dirty: | ||
| runs-on: "shipfox-4vcpu-ubuntu-2404" | ||
| env: | ||
| GOPATH: /tmp/go | ||
| GOLANGCI_LINT_CACHE: /tmp/golangci-lint | ||
| steps: | ||
| - uses: 'actions/checkout@v4' | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Setup Env | ||
| uses: ./.github/actions/default | ||
| with: | ||
| token: ${{ secrets.NUMARY_GITHUB_TOKEN }} | ||
| - run: > | ||
| nix develop --impure --command just pre-commit | ||
| - name: Get changed files | ||
| id: changed-files | ||
| shell: bash | ||
| run: | | ||
| hasChanged=$(git status --porcelain) | ||
| if (( $(echo ${#hasChanged}) != 0 )); then | ||
| git status | ||
| echo "There are changes in the repository" | ||
| git diff | ||
| exit 1 | ||
| fi | ||
|
|
||
| Tests: | ||
| runs-on: "shipfox-4vcpu-ubuntu-2404" | ||
| env: | ||
| GOPATH: /tmp/go | ||
| steps: | ||
| - uses: 'actions/checkout@v4' | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Setup Env | ||
| uses: ./.github/actions/default | ||
| with: | ||
| token: ${{ secrets.NUMARY_GITHUB_TOKEN }} | ||
| - run: > | ||
| nix develop --impure --command just tests | ||
| - name: Upload coverage reports to Codecov with GitHub Action | ||
| uses: codecov/codecov-action@v5.4.3 | ||
| env: | ||
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
|
||
| GoReleaser: | ||
| runs-on: "shipfox-4vcpu-ubuntu-2404" | ||
| if: contains(github.event.pull_request.labels.*.name, 'build-images') || github.ref == 'refs/heads/main' || github.event_name == 'merge_group' | ||
| needs: | ||
| - Dirty | ||
| steps: | ||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
| - uses: earthly/actions-setup@v1 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| version: "latest" | ||
| - uses: 'actions/checkout@v4' | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Setup Env | ||
| uses: ./.github/actions/default | ||
| with: | ||
| token: ${{ secrets.NUMARY_GITHUB_TOKEN }} | ||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
| - name: Login to GitHub Container Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: "NumaryBot" | ||
| password: ${{ secrets.NUMARY_GITHUB_TOKEN }} | ||
| - run: > | ||
| nix develop --impure --command just release-ci | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }} | ||
| GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| name: Release | ||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*.*.*' | ||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| GoReleaser: | ||
| runs-on: "shipfox-4vcpu-ubuntu-2404" | ||
| steps: | ||
| - uses: 'actions/checkout@v4' | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Setup Env | ||
| uses: ./.github/actions/default | ||
| with: | ||
| token: ${{ secrets.NUMARY_GITHUB_TOKEN }} | ||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
| - name: Login to GitHub Container Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: "NumaryBot" | ||
| password: ${{ secrets.NUMARY_GITHUB_TOKEN }} | ||
| - run: > | ||
| nix develop --impure --command just release | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }} | ||
| GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| set dotenv-load | ||
|
|
||
| default: | ||
| @just --list | ||
|
|
||
| pre-commit: generate tidy lint | ||
| pc: pre-commit | ||
|
|
||
| lint: | ||
| @golangci-lint run --fix --build-tags it --timeout 5m | ||
|
|
||
| tidy: | ||
| @go mod tidy | ||
|
|
||
| generate: | ||
| @antlr4 -Dlanguage=Go Lexer.g4 Numscript.g4 -o internal/parser/antlrParser -package antlrParser | ||
| @mv internal/parser/antlrParser/_lexer.go internal/parser/antlrParser/lexer.go | ||
|
|
||
| tests: | ||
| @go test -race -covermode=atomic \ | ||
| -coverprofile coverage.txt \ | ||
| ./... | ||
|
|
||
| release-local: | ||
| @goreleaser release --nightly --skip=publish --clean | ||
|
|
||
| release-ci: | ||
| @goreleaser release --nightly --clean | ||
|
|
||
| release: | ||
| @goreleaser release --clean | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.