Commit Graph

36 Commits

Author SHA1 Message Date
Alfi Maulana
db9fa0b745
test: use Vitest for testing (#564)
Some checks are pending
Build / Build Package (push) Waiting to run
Check / Check Package (push) Waiting to run
Test / Test Package (push) Waiting to run
Test / Test Action (macos-14) (push) Waiting to run
Test / Test Action (ubuntu-24.04) (push) Waiting to run
Test / Test Action (windows-2022) (push) Waiting to run
Test / Test Action With Specified Directories (push) Waiting to run
Test / Test Action Without Run Build (push) Waiting to run
Test / Test Action With Additional Options (push) Waiting to run
Test / Test Action With Custom Generator (push) Waiting to run
* test: use Vitest for testing

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>

* build: remove `esModuleInterop` option in TypeScript configuration

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>

---------

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>
2025-01-03 22:53:57 +07:00
Alfi Maulana
8f79315420
feat: add function for parsing arguments with quotes (#532)
* feat: add `parse` function

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>

* chore: remoev unused shell-quote from dependencies

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>

* test: update `context.test.ts` test

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>

---------

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>
2024-11-26 18:43:30 +08:00
Alfi Maulana
a93af4bd1e
feat: log executed command (#524)
Some checks failed
Build / Build Package (push) Failing after 1s
Test / Test Action (ubuntu-22.04) (push) Failing after 30s
Test / Test Action With Specified Directories (push) Failing after 35s
Check / Check Package (push) Failing after 1s
Test / Test Package (push) Failing after 1s
Test / Test Action Without Run Build (push) Failing after 36s
Test / Test Action With Additional Options (push) Failing after 3s
Test / Test Action With Custom Generator (push) Failing after 2s
Test / Test Action (macos-14) (push) Has been cancelled
Test / Test Action (windows-2022) (push) Has been cancelled
* feat: log executed command

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>

* feat: log command based on spawned process arguments

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>

---------

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>
2024-11-24 23:34:31 +08:00
Alfi Maulana
478382dd46
feat: use asynchronous version of the exec file function (#522)
* feat: add `exec` function

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>

* feat: use `exec` function in `configureProject` and `buildProject` functions

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>

---------

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>
2024-11-21 22:16:53 +07:00
Alfi Maulana
6f8b21d703
feat: parse multi values inputs with quotation (#520)
* feat: parse quotation in `options` input

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>

* feat: parse quotation in `args` input

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>

* feat: parse quotation in `build-args` input

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>

---------

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>
2024-11-21 21:16:54 +07:00
dependabot[bot]
d62c3d86bd
chore: bump gha-utils from 0.2.0 to 0.3.0 (#446)
Bumps [gha-utils](https://github.com/threeal/gha-utils) from 0.2.0 to 0.3.0.
- [Release notes](https://github.com/threeal/gha-utils/releases)
- [Commits](https://github.com/threeal/gha-utils/compare/v0.2.0...v0.3.0)

---
updated-dependencies:
- dependency-name: gha-utils
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alfi Maulana <alfi.maulana.f@gmail.com>
2024-09-19 23:59:36 +08:00
dependabot[bot]
e3dae2824f
chore: bump gha-utils from 0.1.0 to 0.2.0 (#414)
Bumps [gha-utils](https://github.com/threeal/gha-utils) from 0.1.0 to 0.2.0.
- [Release notes](https://github.com/threeal/gha-utils/releases)
- [Commits](https://github.com/threeal/gha-utils/compare/v0.1.0...v0.2.0)

---
updated-dependencies:
- dependency-name: gha-utils
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alfi Maulana <alfi.maulana.f@gmail.com>
2024-08-17 22:12:49 +07:00
Alfi Maulana
4c4646891f
refactor: rename index.ts to action.ts (#408) 2024-08-08 17:00:08 +08:00
Alfi Maulana
571e81560b
feat: utilize GitHub Actions Utilities package (#406)
* feat: utilize GitHub Actions Utilities package

* test: modify get action context test by mocking `getInput` function
2024-08-08 16:29:56 +08:00
Alfi Maulana
d1c539d005
refactor: refactor inputs to context (#400)
* refactor: rename `inputs` to `context`

* refactor: merge compiler and flags inputs to options input

* refactor: separate configure and build context
2024-08-07 22:20:14 +08:00
Alfi Maulana
44a0a4c6c2
refactor: remove core actions toolkit dependency (#397)
* refactor: add a `getInput` function

* refactor: replace `core.getBooleanInput` with `getInput`

* refactor: replace `core.getMultilineInput` with `getInput`

* refactor: replace `core.setOutput` with dirrect append to `GITHUB_OUTPUT`

* refactor: replace `core.setFailed` with direct stdout write
2024-08-06 22:42:23 +07:00
Alfi Maulana
fe729787d8
build: enable TypeScript strict configuration (#395)
* feat: utilize catched-error-message to parse catched error

* test: fix typing in `inputs.test.ts`

* build: enable TypeScript strict configuration

* build: configure TypeScript to skip library check
2024-08-06 16:41:09 +08:00
Alfi Maulana
23aad7b33f
feat: use child process package to execute command (#391)
* feat: use `execFileSync` from `node:child_process` package

* feat: modify `configureProject` function to be sync

* feat: modify `buildProject` function to be sync

* feat: display command output to the parent output
2024-08-06 12:29:28 +08:00
Alfi Maulana
3ca3a29821
refactor: remove main function and move its content to top level (#298) 2024-04-15 21:22:35 +08:00
Alfi Maulana
f06670a909
test: utilize new flat ESLint configuration (#294)
* test: utilize new flat ESLint configuration

* test: add TypeScript support to new flat ESLint config

* test: fix `@typescript-eslint/consistent-indexed-object-style` lint issue
2024-04-12 22:55:35 +08:00
Alfi Maulana
d83693c521
feat: remove redundant specification of CMake source directory (#273)
* feat: remove setting the default of `source-dir` to `.`

* feat: append source dir to configure Cmake args only if specified
2024-03-25 14:03:03 +08:00
Alfi Maulana
6c4e2145fb
test: utilize partial test case inputs in cmake.test.ts (#272) 2024-03-25 12:52:35 +08:00
Alfi Maulana
21ddda7def
fix: fix default build dir not relative to source dir (#269)
* test: fix get action inputs test when source dir specified

* fix: default build dir should relative to source dir

* ci: fix test directory location
2024-03-25 12:25:14 +08:00
Alfi Maulana
5c7d8af23f
test: specify Action inputs testing one by one (#268)
* test: refactor testing in `inputs.test.ts`

* test: simplify mocking in `inputs.test.ts` testing

* test: use test case in `inputs.test.ts` testing

* test: add more test cases in `inputs.test.ts` testing
2024-03-25 11:58:49 +08:00
Alfi Maulana
0df49588a5
refactor: add CMake execution functions (#263)
* refactor: add `configureProject` function from lines in `main` function

* test: add test for `configureProject` function

* refactor: add `buildProject` function from lines in `main` function
2024-03-24 23:41:08 +08:00
Alfi Maulana
4427f0f36d
feat: remove support for auto-install Ninja (#258)
* feat: remove support for auto-installing Ninja

* ci: add step for setting up Ninja in `test-action-with-custom-tools` job

* docs: update readme related to auto-install Ninja support removal
2024-03-22 18:14:44 +08:00
Alfi Maulana
ebf367c0a0
feat: remove support for testing CMake projects (#256)
* feat: remove `run-test` and `test-args` action inputs

* docs: remove description for supporting testing
2024-03-22 17:06:56 +08:00
Alfi Maulana
f948a9da23
test: reimplement unit testing (#229)
* test: add test for `getInputs` function

* ci(test): add `test-package` job
2024-03-08 21:20:32 +07:00
Alfi Maulana
30c1178974
feat: add function for getting action inputs (#225)
* feat: add `getInputs` function

* feat: specify default input value in `getInputs` function
2024-03-04 22:53:41 +08:00
Alfi Maulana
d37829ef6a
build: build distribution files directly from TypeScript files (#221)
* build: build dist directly from TypeScript sources

* build(ts): adjust options in `tsconfig.json`

* fix: import all instead of default in @actions modules
2024-03-04 21:16:05 +08:00
Alfi Maulana
e0f6aeea02
refactor: rename source files extension to .ts (#219) 2024-03-04 21:01:48 +08:00
Alfi Maulana
28146ffccf
ci: remove unit testing (#198)
* ci(test): remove `test-package` job

* test: remove testing using Jest

* test(eslint): remove `parserOptions` entry
2024-02-16 13:13:16 +07:00
Alfi Maulana
dd9fe54799
feat: catch error when calling the main function (#138) 2023-12-14 19:37:47 +08:00
Alfi Maulana
65845a480e
build: adjust source files structures (#136)
* build(typescript): disable from generating source map

* build(typescript): disable from generating declaration file

* build(typescript): modify source files to be compiled to the same dir

* build(typescript): modify distribution files to be generated to `dist` directory

* refactor: rename main entrypoint from `main` to `index`

* chore(git): specify attribute for `dist` directory instead of just `dist/index.mjs`
2023-12-14 19:20:50 +08:00
Alfi Maulana
96089ee386
test: write test in JavaScript (#108)
* test: map imported module from the distribution files

* chore: remove @jest/globals, @types/jest, and ts-jest from dependencies

* test: modify test files to JavaScript

* test: remove `testMatch` option in Jest (redundant)

* build: remove `tsconfig.eslint.json`

* ci(test): set `--experimental-vm-modules` only on `Test Package` step instead
2023-12-11 20:38:06 +08:00
Alfi Maulana
dd1c44061d
feat: install Ninja if it was not available (#82)
* feat: install Ninja if generator is Ninja

* feat: only install ninja if it was not installed
2023-11-21 20:45:38 +07:00
Alfi Maulana
025d277e55
feat: pass more arguments during CMake configuration (#78)
* feat: parse and pass `generator` input

* feat: parse and pass `c-compiler` and `cxx-compiler` inputs

* feat: parse and pass `c-flags` and `cxx-flags` inputs

* feat: parse and pass `options` input

* feat: parse and pass `args` input
2023-11-20 21:52:38 +07:00
Alfi Maulana
1829bd6347
feat: run CTest from the JavaScript Action (#77)
* feat: run CTest if `run-test` is true

* feat: run CMake build if `run-test` set to true
2023-11-20 21:19:04 +07:00
Alfi Maulana
421f12e1db
feat: run CMake build from the JavaScript Action (#75)
* feat: add CMake build step

* feat: only run CMake build step if `run-build` input is true

* feat: pass `build-args` input to the CMake build command

* fix: split lines from `getMultilineInput` with a whitespace
2023-11-20 20:51:25 +07:00
Alfi Maulana
48cb08d783
feat: configure CMake from the JavaScript Action (#72)
* feat(action): modify to run `main/index.mjs` on Node 20

* feat: add configure cmake step

* feat: output build directory

* feat: get `source-dir` and `build-dir` inputs
2023-11-20 20:18:21 +07:00
Alfi Maulana
ed7c2d179c
build: initialize JavaScript Action project (#69)
* build: initialize JavaScript action project

* chore(dependabot): check for npm package updates

* style: ignore `main` dir and `README.md` from being formatted

* ci: add Build workflow that contains Build Package job

* ci: add Test Package job in the Test workflow

* test: add an empty `main.test.ts` test

* chore: adjust Git attributes for `main/index.mjs` file

* docs(readme): add a build status badge
2023-11-20 18:25:22 +07:00