Skip to content

Commit 6e54344

Browse files
Initial commit
0 parents  commit 6e54344

24 files changed

Lines changed: 1349 additions & 0 deletions

(here C/C++)

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
strategy:
2+
matrix:
3+
include:
4+
# Analyzes C and C++ code using the commands in `Build C and C++ code`
5+
- language: c-cpp
6+
build-mode: manual
7+
# Analyzes C# code by automatically detecting a build
8+
- language: csharp
9+
build-mode: autobuild
10+
# Analyzes Java code directly from the codebase without a build
11+
- language: java-kotlin
12+
build-mode: none # analyzes Java only
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
# Initializes CodeQL tools and creates a codebase for analysis.
18+
- name: Initialize CodeQL
19+
uses: github/codeql-action/init@v3
20+
with:
21+
languages: ${{ matrix.language }}
22+
- if: ${{ matrix.build-mode == 'manual' }}
23+
name: Build C and C++ code
24+
run: |
25+
echo 'If you are using a "manual" build mode for one or more of the' \
26+
'languages you are analyzing, replace this with the commands to build' \
27+
'your code, for example:'
28+
echo ' make bootstrap'
29+
echo ' make release'
30+
exit 1

-next.0/-next

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker pull jnorwood/helm-docs:latest && docker run --rm --volume "$(pwd)/charts:/helm-docs" -u $(id -u) jnorwood/helm-docs:latest

.github/workflows/webpack.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: NodeJS with Webpack
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [14.x, 16.x, 18.x]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
25+
- name: Build
26+
run: |
27+
npm install
28+
npx webpack

App.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
function MyButton() {
2+
return (
3+
<button>
4+
I'm a button
5+
</button>
6+
);
7+
}
8+
9+
export default function MyApp() {
10+
return (
11+
<div>
12+
<h1>Welcome to my app</h1>
13+
<MyButton />
14+
</div>
15+
);
16+
}

CHANGELOG.md

Lines changed: 231 additions & 0 deletions
Large diffs are not rendered by default.

Java/Kotlin

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/using-workflow-run-logs).

Java/swift build

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Initializes the CodeQL tools for scanning.
2+
- name: Initialize CodeQL
3+
- uses: github/codeql-action/init@v3
4+
with:
5+
languages: ${{ matrix.language }}
6+
build-mode: manual
7+
- uses: github/codeql-action/analyze@v3
8+
with:
9+
category: "/language:${{ matrix.language }}"

Object.defineProperty()

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
const obj = {};
2+
// 1. Using a null prototype: no inherited properties
3+
const descriptor = Object.create(null);
4+
descriptor.value = "static";
5+
6+
// not enumerable, not configurable, not writable as defaults
7+
Object.defineProperty(obj, "key", descriptor);
8+
9+
// 2. Being explicit by using a throw-away object literal with all attributes present
10+
Object.defineProperty(obj, "key2", {
11+
enumerable: false,
12+
configurable: false,
13+
writable: false,
14+
value: "static",
15+
});
16+
17+
// 3. Recycling same object
18+
function withValue(value) {
19+
const d =
20+
withValue.d ||
21+
(withValue.d = {
22+
enumerable: false,
23+
writable: false,
24+
configurable: false,
25+
value,
26+
});
27+
28+
// avoiding duplicate operation for assigning value
29+
if (d.value !== value) d.value = value;
30+
31+
return d;
32+
}
33+
// and
34+
Object.defineProperty(obj, "key", withValue("static"));
35+
36+
// if freeze is available, prevents adding or
37+
// removing the object prototype properties
38+
// (value, get, set, enumerable, writable, configurable)
39+
(Object.freeze || Object)(Object.prototype);

README.md

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# Docker.md
2+
https://github.com/AS-BIG-FEMALE/.github-DEVELOPMENT.md/issues/9#issuecomment-2117984653
3+
4+
# Setup pnpm
5+
6+
Install pnpm package manager.
7+
8+
## Inputs
9+
10+
### `version`
11+
12+
Version of pnpm to install.
13+
14+
**Optional** when there is a [`packageManager` field in the `package.json`](https://nodejs.org/api/corepack.html).
15+
16+
otherwise, this field is **required** It supports npm versioning scheme, it could be an exact version (such as `6.24.1`), or a version range (such as `6`, `6.x.x`, `6.24.x`, `^6.24.1`, `*`, etc.), or `latest`.
17+
18+
### `dest`
19+
20+
**Optional** Where to store pnpm files.
21+
22+
### `run_install`
23+
24+
**Optional** (_default:_ `null`) If specified, run `pnpm install`.
25+
26+
If `run_install` is either `null` or `false`, pnpm will not install any npm package.
27+
28+
If `run_install` is `true`, pnpm will install dependencies recursively.
29+
30+
If `run_install` is a YAML string representation of either an object or an array, pnpm will execute every install commands.
31+
32+
#### `run_install.recursive`
33+
34+
**Optional** (_type:_ `boolean`, _default:_ `false`) Whether to use `pnpm recursive install`.
35+
36+
#### `run_install.cwd`
37+
38+
**Optional** (_type:_ `string`) Working directory when run `pnpm [recursive] install`.
39+
40+
#### `run_install.args`
41+
42+
**Optional** (_type:_ `string[]`) Additional arguments after `pnpm [recursive] install`, e.g. `[--frozen-lockfile, --strict-peer-dependencies]`.
43+
44+
### `package_json_file`
45+
46+
**Optional** (_type:_ `string`, _default:_ `package.json`) File path to the `package.json` to read "packageManager" configuration.
47+
48+
### `standalone`
49+
50+
**Optional** (_type:_ `boolean`, _default:_ `false`) When set to true, [@pnpm/exe](https://www.npmjs.com/package/@pnpm/exe), which is a Node.js bundled package, will be installed, enabling using `pnpm` without Node.js.
51+
52+
This is useful when you want to use a incompatible pair of Node.js and pnpm.
53+
54+
## Outputs
55+
56+
### `dest`
57+
58+
Expanded path of inputs#dest.
59+
60+
### `bin_dest`
61+
62+
Location of `pnpm` and `pnpx` command.
63+
64+
## Usage example
65+
66+
### Just install pnpm
67+
68+
```yaml
69+
on:
70+
- push
71+
- pull_request
72+
73+
jobs:
74+
install:
75+
runs-on: ubuntu-latest
76+
77+
steps:
78+
- uses: pnpm/action-setup@v4
79+
with:
80+
version: 8
81+
```
82+
83+
### Install pnpm and a few npm packages
84+
85+
```yaml
86+
on:
87+
- push
88+
- pull_request
89+
90+
jobs:
91+
install:
92+
runs-on: ubuntu-latest
93+
94+
steps:
95+
- uses: actions/checkout@v4
96+
97+
- uses: pnpm/action-setup@v4
98+
with:
99+
version: 8
100+
run_install: |
101+
- recursive: true
102+
args: [--frozen-lockfile, --strict-peer-dependencies]
103+
- args: [--global, gulp, prettier, typescript]
104+
```
105+
106+
### Use cache to reduce installation time
107+
108+
```yaml
109+
on:
110+
- push
111+
- pull_request
112+
113+
jobs:
114+
cache-and-install:
115+
runs-on: ubuntu-latest
116+
117+
steps:
118+
- name: Checkout
119+
uses: actions/checkout@v4
120+
121+
- uses: pnpm/action-setup@v4
122+
name: Install pnpm
123+
with:
124+
version: 8
125+
run_install: false
126+
127+
- name: Install Node.js
128+
uses: actions/setup-node@v4
129+
with:
130+
node-version: 20
131+
cache: 'pnpm'
132+
133+
- name: Get pnpm store directory
134+
shell: bash
135+
run: |
136+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
137+
138+
- uses: actions/cache@v4
139+
name: Setup pnpm cache
140+
with:
141+
path: ${{ env.STORE_PATH }}
142+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
143+
restore-keys: |
144+
${{ runner.os }}-pnpm-store-
145+
146+
- name: Install dependencies
147+
run: pnpm install
148+
```
149+
150+
**Note:** You don't need to run `pnpm store prune` at the end; post-action has already taken care of that.
151+
152+
## Notes
153+
154+
This action does not setup Node.js for you, use [actions/setup-node](https://github.com/actions/setup-node) yourself.
155+
156+
## License
157+
158+
[MIT](https://github.com/pnpm/action-setup/blob/master/LICENSE.md) © [Hoàng Văn Khải](https://github.com/KSXGitHub/)

cli.ts

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#! /usr/bin/env -S deno -A
2+
import args from "https://deno.land/x/args@1.0.2/wrapper.ts";
3+
import {
4+
EarlyExitFlag,
5+
BinaryFlag,
6+
PartialOption,
7+
} from "https://deno.land/x/args@1.0.2/flag-types.ts";
8+
import {
9+
Text,
10+
Integer,
11+
} from "https://deno.land/x/args@1.0.2/value-types.ts";
12+
import {
13+
MAIN_COMMAND,
14+
} from "https://deno.land/x/args@1.0.2/symbols.ts";
15+
import run from "./run.ts";
16+
17+
const parser = args
18+
.describe("Run deno test files on localhost")
19+
.with(EarlyExitFlag("help", {
20+
alias: ["?"],
21+
describe: "Show help",
22+
exit() {
23+
console.log("USAGE:");
24+
console.log(" deno -A cli.ts [options] ...files");
25+
console.log(parser.help());
26+
return Deno.exit(0);
27+
},
28+
}))
29+
.with(PartialOption("dir", {
30+
alias: ["d"],
31+
describe: "Target directory",
32+
type: Text,
33+
default: ".",
34+
}))
35+
.with(PartialOption("port", {
36+
alias: ["p"],
37+
describe: "Port to use",
38+
type: Integer,
39+
default: 4321n,
40+
}))
41+
.with(PartialOption("hostname", {
42+
alias: ["h"],
43+
describe: "Hostname to use",
44+
type: Text,
45+
default: "0.0.0.0",
46+
}))
47+
.with(BinaryFlag("cors", {
48+
describe: "Enable Cross-Origin Resource Sharing",
49+
}))
50+
.with(PartialOption("deno", {
51+
describe: "Deno command",
52+
type: Text,
53+
default: "deno",
54+
}));
55+
56+
const parserRes = parser.parse(Deno.args);
57+
if (parserRes.tag !== MAIN_COMMAND) {
58+
console.error(parserRes.error.toString());
59+
throw Deno.exit(1);
60+
}
61+
if (parserRes.remaining().rawFlags().length) {
62+
console.error("Unknown flags:", ...parserRes.remaining().rawFlags());
63+
throw Deno.exit(1);
64+
}
65+
66+
const {
67+
dir,
68+
hostname,
69+
port,
70+
cors,
71+
deno,
72+
} = parserRes.value;
73+
74+
const testFiles = parserRes.remaining().rawValues();
75+
76+
Deno.chdir(dir);
77+
const { code, signal } = await run({
78+
list: testFiles.length ? testFiles : undefined,
79+
hostname,
80+
port: Number(port),
81+
deno,
82+
cors,
83+
});
84+
if (signal) console.error("SIGNAL", signal);
85+
throw Deno.exit(code);

0 commit comments

Comments
 (0)