Skip to content

Commit

Permalink
add gmod addon generator script
Browse files Browse the repository at this point in the history
  • Loading branch information
luttje committed Dec 1, 2024
1 parent 66cb87e commit 00bd89b
Show file tree
Hide file tree
Showing 7 changed files with 992 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ root = true
charset = utf-8
end_of_line = LF
quote_type = single
insert_final_newline = true
trim_trailing_whitespace = true

[*.lua]
indent_style = space
Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/publish_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
tags:
- 'v*'

jobs:
publish_rock_and_build_ubuntu:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -67,6 +67,23 @@ jobs:
name: jestronaut-windows
path: dist/jestronaut-windows.exe

build_gmod_addon:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm ci
- name: Build the GMod addon
run: npm run build:gmod
- name: Upload GMod addon artifact
uses: actions/upload-artifact@v3
with:
name: jestronaut-gmod
path: dist/gmod-addon.zip

publish_github:
runs-on: ubuntu-latest
needs: [publish_rock_and_build_ubuntu, build_windows]
Expand Down Expand Up @@ -95,4 +112,5 @@ jobs:
title: "Latest (automatic build)"
files: |
dist/jestronaut-ubuntu
dist/jestronaut-windows.exe
dist/jestronaut-windows.exe
dist/gmod-addon.zip
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ This binary is a standalone executable that can be used to run Jestronaut tests
>
> The variable `MSYS_NO_PATHCONV=1` is only required on Windows when using MSYS2 (for example with Git for Windows). It prevents the path from being converted to a Windows path, which would result in an incorrect path.
### Running tests in Garry's Mod

See [the Jestronaut Garry's Mod addon README](./gmod-addon/README.md) for more information.
## 🧪 API
Jestronaut tries to match [the API of Jest](https://jestjs.io/docs/api) as closely as possible. Here are some examples of how to use it:
Expand Down Expand Up @@ -238,4 +242,4 @@ Use `luarocks test` in the root of this repo to execute the Jestronaut tests.
For coverage install the following LuaRocks modules:
* `luarocks install luacov`
* `luarocks install luacov-reporter-lcov`
* `luarocks install luacov-reporter-lcov`
13 changes: 11 additions & 2 deletions gmod-addon/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# Jestronaut - Garry's Mod Addon
# Jestronaut - Garry's Mod Addon`

## Installation

1. Download the addon from the latest Jestronaut release from the
[releases page](https://github.com/luttje/jestronaut/releases).

2. Extract the contents of the `gmod-addon.zip` file to your Garry's Mod `addons` folder.

3. Restart Garry's Mod if it was running.

## Usage

Expand Down Expand Up @@ -70,4 +79,4 @@
Ran all test suites.
```

*Note that the emoji icons are displayed as `□□` in the Garry's Mod console due to insufficient Unicode support.*
*Note that the emoji icons are displayed as `□□` in the Garry's Mod console due to insufficient Unicode support.*
Loading

0 comments on commit 00bd89b

Please sign in to comment.