This commit is contained in:
Alfi Maulana 2024-08-08 14:03:55 +00:00 committed by GitHub
commit dd8799c9da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 153 additions and 23 deletions

9
configure/README.md Normal file
View File

@ -0,0 +1,9 @@
# Configure CMake Action
Configure [CMake](https://cmake.org/) projects on [GitHub Actions](https://github.com/features/actions).
## License
This project is licensed under the terms of the [MIT License](../LICENSE).
Copyright © 2023-2024 [Alfi Maulana](https://github.com/threeal/)

32
configure/action.yml Normal file
View File

@ -0,0 +1,32 @@
name: Configure CMake Action
description: Configure CMake projects
author: Alfi Maulana
branding:
color: gray-dark
icon: terminal
inputs:
source-dir:
description: The source directory of the CMake project
build-dir:
description: The build directory of the CMake project
generator:
description: The build system generator for the CMake project
c-compiler:
description: The preferred executable for compiling C language files
cxx-compiler:
description: The preferred executable for compiling C++ language files
c-flags:
description: Additional flags to pass when compiling C language files
cxx-flags:
description: Additional flags to pass when compiling C++ language files
options:
description: Additional options to pass during the CMake configuration
args:
description: Additional arguments to pass during the CMake configuration
outputs:
build-dir:
description: The build directory of the CMake project
value: ${{ steps.process-inputs.outputs.build-dir }}
runs:
using: node20
main: dist/action.mjs

View File

@ -0,0 +1,11 @@
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
export default [
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
{
ignores: [".*", "dist"],
},
];

View File

@ -0,0 +1,20 @@
{
"collectCoverage": true,
"coverageReporters": ["text"],
"coverageThreshold": {
"global": {
"branches": 100,
"functions": 100,
"lines": 100,
"statements": 100
}
},
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.js$": "$1"
},
"preset": "ts-jest/presets/default-esm",
"transform": {
"^.+\\.ts$": ["ts-jest", { "useESM": true }]
},
"verbose": true
}

34
configure/package.json Normal file
View File

@ -0,0 +1,34 @@
{
"name": "cmake-action-configure",
"private": true,
"type": "module",
"workspaces": [
"lib/*"
],
"scripts": {
"build": "rollup -c",
"format": "prettier --write --cache . !dist !README.md",
"lint": "eslint",
"test": "jest"
},
"dependencies": {
"gha-utils": "^0.1.0"
},
"devDependencies": {
"@eslint/js": "^9.8.0",
"@jest/globals": "^29.7.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"@types/jest": "^29.5.12",
"@types/node": "^22.1.0",
"eslint": "^9.8.0",
"jest": "^29.7.0",
"prettier": "^3.3.3",
"rollup": "^4.20.0",
"ts-jest": "^29.2.4",
"tslib": "^2.6.3",
"typescript": "^5.5.4",
"typescript-eslint": "^8.0.0"
},
"packageManager": "yarn@4.4.0"
}

View File

@ -0,0 +1,11 @@
import { nodeResolve } from "@rollup/plugin-node-resolve";
import typescript from "@rollup/plugin-typescript";
export default {
input: "src/action.ts",
output: {
dir: "dist",
entryFileNames: "[name].mjs",
},
plugins: [nodeResolve(), typescript()],
};

13
configure/tsconfig.json Normal file
View File

@ -0,0 +1,13 @@
{
"include": ["src"],
"exclude": ["**/*.test.ts"],
"compilerOptions": {
"exactOptionalPropertyTypes": true,
"strict": true,
"module": "node16",
"moduleResolution": "node16",
"esModuleInterop": true,
"target": "es2022",
"skipLibCheck": true
}
}

View File

@ -1,5 +1,5 @@
{
"name": "root",
"name": "cmake-action",
"private": true,
"type": "module",
"scripts": {

44
yarn.lock generated
View File

@ -1737,6 +1737,28 @@ __metadata:
languageName: node
linkType: hard
"cmake-action@workspace:.":
version: 0.0.0-use.local
resolution: "cmake-action@workspace:."
dependencies:
"@eslint/js": "npm:^9.8.0"
"@jest/globals": "npm:^29.7.0"
"@rollup/plugin-node-resolve": "npm:^15.2.3"
"@rollup/plugin-typescript": "npm:^11.1.6"
"@types/jest": "npm:^29.5.12"
"@types/node": "npm:^22.1.0"
eslint: "npm:^9.8.0"
gha-utils: "npm:^0.1.0"
jest: "npm:^29.7.0"
prettier: "npm:^3.3.3"
rollup: "npm:^4.20.0"
ts-jest: "npm:^29.2.4"
tslib: "npm:^2.6.3"
typescript: "npm:^5.5.4"
typescript-eslint: "npm:^8.0.0"
languageName: unknown
linkType: soft
"co@npm:^4.6.0":
version: 4.6.0
resolution: "co@npm:4.6.0"
@ -4122,28 +4144,6 @@ __metadata:
languageName: node
linkType: hard
"root@workspace:.":
version: 0.0.0-use.local
resolution: "root@workspace:."
dependencies:
"@eslint/js": "npm:^9.8.0"
"@jest/globals": "npm:^29.7.0"
"@rollup/plugin-node-resolve": "npm:^15.2.3"
"@rollup/plugin-typescript": "npm:^11.1.6"
"@types/jest": "npm:^29.5.12"
"@types/node": "npm:^22.1.0"
eslint: "npm:^9.8.0"
gha-utils: "npm:^0.1.0"
jest: "npm:^29.7.0"
prettier: "npm:^3.3.3"
rollup: "npm:^4.20.0"
ts-jest: "npm:^29.2.4"
tslib: "npm:^2.6.3"
typescript: "npm:^5.5.4"
typescript-eslint: "npm:^8.0.0"
languageName: unknown
linkType: soft
"run-parallel@npm:^1.1.9":
version: 1.2.0
resolution: "run-parallel@npm:1.2.0"