Skip to content

Commit 60fcf4a

Browse files
authored
feat: init (#1)
1 parent d44e6d4 commit 60fcf4a

30 files changed

Lines changed: 36777 additions & 1 deletion

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 2
7+
indent_style = space
8+
insert_final_newline = true
9+
max_line_length = 120
10+
trim_trailing_whitespace = true
11+
12+
[*.sh]
13+
indent_size = 4
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "Setup Environment"
2+
description: "Setting environment for the project"
3+
4+
inputs:
5+
task-version:
6+
description: "Task version"
7+
required: true
8+
default: "3.33.1"
9+
task-enabled:
10+
description: "Task enabled"
11+
required: true
12+
default: "true"
13+
zizmor-version:
14+
description: "Zizmor version"
15+
required: true
16+
default: "1.0.1"
17+
zizmor-enabled:
18+
description: "Zizmor enabled"
19+
required: true
20+
default: "false"
21+
22+
runs:
23+
using: "composite"
24+
steps:
25+
- name: Setup Task
26+
if: ${{ inputs.task-enabled == 'true' }}
27+
uses: arduino/setup-task@v2.0.0
28+
with:
29+
version: ${{ inputs.task-version }}
30+
31+
- name: Setup Zizmor
32+
if: ${{ inputs.zizmor-enabled == 'true' }}
33+
shell: bash
34+
run: |
35+
python -m pip install --upgrade pip
36+
python -m pip install "zizmor==${ZIZMOR_VERSION}"
37+
env:
38+
ZIZMOR_VERSION: ${{ inputs.zizmor-version }}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Check PR Title
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- synchronize
9+
- edited
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.number }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
check-pr-title:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout config file
21+
uses: actions/checkout@v4
22+
with:
23+
persist-credentials: false
24+
sparse-checkout: |
25+
commitlint.config.js
26+
sparse-checkout-cone-mode: false
27+
28+
- name: Commitlint PR Title
29+
uses: ovsds/commitlint-pr-title-action@v1
30+
with:
31+
config_file: ./commitlint.config.js

.github/workflows/check-pr.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Check PR
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- synchronize
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.number }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
check-pr:
16+
runs-on: ubuntu-latest
17+
18+
permissions:
19+
contents: read
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
with:
25+
persist-credentials: false
26+
27+
- name: Setup Environment
28+
uses: ./.github/actions/setup_environment
29+
with:
30+
zizmor-enabled: true
31+
32+
- name: Install Dependencies
33+
run: |
34+
task init
35+
36+
- name: Lint PR
37+
run: |
38+
task lint
39+
env:
40+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Required for Zizmor
41+
42+
- name: Test PR
43+
run: |
44+
task test
45+
46+
- name: Package PR
47+
run: |
48+
task package
49+
50+
- name: Compare the expected and actual dist/ directories
51+
run: |
52+
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
53+
echo "Detected uncommitted changes after build. See status below:"
54+
git diff
55+
exit 1
56+
fi

.github/workflows/e2e.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: E2E
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- synchronize
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.number }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
e2e-default:
16+
runs-on: ubuntu-latest
17+
18+
permissions:
19+
contents: read
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
with:
25+
persist-credentials: false
26+
27+
- name: Test Run
28+
id: test-run
29+
uses: ./
30+
with:
31+
placeholder: "test_placeholder"
32+
33+
- name: Assert placeholder
34+
uses: nick-fields/assert-action@v2
35+
with:
36+
actual: ${{ steps.test-run.outputs.placeholder }}
37+
expected: "test_placeholder"
38+
e2e:
39+
runs-on: ubuntu-latest
40+
if: always() && !cancelled()
41+
42+
needs:
43+
- e2e-default
44+
45+
steps:
46+
- name: Collect Results
47+
uses: ovsds/collect-needs-result-action@v1
48+
with:
49+
needs_json: ${{ toJson(needs) }}
50+
skip_allowed: false
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Push version tags
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}
9+
cancel-in-progress: false
10+
11+
jobs:
12+
push-version-tags:
13+
runs-on: ubuntu-latest
14+
15+
permissions:
16+
contents: write
17+
18+
steps:
19+
- name: Push Version Tags
20+
uses: ovsds/push-version-tags-action@v1
21+
with:
22+
version: ${{ github.event.release.tag_name }}

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# OS
2+
.DS_Store
3+
4+
# IDE
5+
.idea/
6+
.vscode/
7+
8+
# Dependencies
9+
node_modules/
10+
11+
# Build files
12+
lib/**/*

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no -- commitlint --edit

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

.npmrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fund=false
2+
audit=false
3+
save-exact=true
4+
engine-strict=true
5+
update-notifier=false

0 commit comments

Comments
 (0)