Skip to content

Commit b3e0377

Browse files
committed
remove docs, add best practices scripts and fix CI with v1 action tests
1 parent 3f70aca commit b3e0377

63 files changed

Lines changed: 14413 additions & 6249 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.cjs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
root: true,
3+
parser: "@typescript-eslint/parser",
4+
parserOptions: {
5+
ecmaVersion: "latest",
6+
sourceType: "module"
7+
},
8+
plugins: ["@typescript-eslint"],
9+
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
10+
ignorePatterns: ["dist"],
11+
env: {
12+
node: true,
13+
es2022: true
14+
}
15+
};

.github/.codecov.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
codecov:
2+
require_ci_to_pass: true
3+
4+
comment:
5+
layout: "reach, diff, flags, files"
6+
behavior: default
7+
require_changes: false # Set to true to only comment if coverage changes
8+
require_base: false # Set to true to require a base commit to compare
9+
require_head: true # Set to true to require a head commit
10+
hide_project_coverage: false # Set to true to hide project-wide coverage
11+
12+
coverage:
13+
status:
14+
project:
15+
default:
16+
target: auto # Target coverage is the previous commit's coverage
17+
threshold: 1% # Allow a 1% drop without failing
18+
base: auto
19+
if_no_uploads: error
20+
if_not_found: success
21+
if_ci_failed: error
22+
patch:
23+
default:
24+
target: auto
25+
threshold: 1%
26+
base: auto
27+
if_no_uploads: error
28+
if_not_found: success
29+
if_ci_failed: error
30+
31+
ignore:
32+
- "dist/**"
33+
- "test/**"
34+
- "**/*.test.ts"
35+
- "**/*.spec.ts"

.github/ISSUE_TEMPLATE/bug-report.md

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ""
5+
labels: ""
6+
assignees: ""
7+
---
8+
9+
IMPORTANT: Please read about the limitation of [non-file dependencies](https://github.com/awalsh128/cache-apt-pkgs-action/blob/master/README.md#non-file-dependencies) before filing an issue.
10+
11+
**Describe the bug**
12+
A clear and concise description of what the bug is.
13+
14+
**To Reproduce**
15+
Steps to reproduce the behavior:
16+
17+
1. Go to '...'
18+
2. Click on '....'
19+
3. Scroll down to '....'
20+
4. See error
21+
22+
**Expected behavior**
23+
A clear and concise description of what you expected to happen.
24+
25+
**Screenshots**
26+
If applicable, add screenshots to help explain your problem.
27+
28+
**Desktop (please complete the following information):**
29+
30+
- OS: [e.g. iOS]
31+
- Browser [e.g. chrome, safari]
32+
- Version [e.g. 22]
33+
34+
**Smartphone (please complete the following information):**
35+
36+
- Device: [e.g. iPhone6]
37+
- OS: [e.g. iOS8.1]
38+
- Browser [e.g. stock browser, safari]
39+
- Version [e.g. 22]
40+
41+
**Additional context**
42+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/actions/codehealth/action.yml

Lines changed: 0 additions & 85 deletions
This file was deleted.

.github/actions/setup-env/action.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/actions/setup/action.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: "Setup environment"
2+
description: "Checks out code, sets up Node.js, and builds the project or fetches cached build artifacts, caching build artifacts for faster subsequent runs"
3+
4+
inputs:
5+
operation:
6+
description: "The operation to perform. Can be 'build' or 'fetch' (default: 'fetch')."
7+
required: true
8+
default: "fetch"
9+
values:
10+
- "build"
11+
- "fetch"
12+
13+
runs:
14+
using: "composite"
15+
steps:
16+
- name: Setup Node.js
17+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
18+
with:
19+
node-version: 24
20+
cache: "npm"
21+
22+
- name: Get Bundle Artifacts Name
23+
id: get-artifacts-name
24+
shell: bash
25+
env:
26+
bundle_artifacts_name: "action-bundle-${{ github.event.pull_request.head.sha || github.sha }}"
27+
run: |
28+
echo "bundle-artifacts-name=${{ env.bundle_artifacts_name }}" >> $GITHUB_ENV
29+
30+
- name: Try Fetch Bundle Artifacts
31+
if: ${{ inputs.operation == 'fetch' }}
32+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
33+
continue-on-error: true
34+
with:
35+
name: ${{ env.bundle-artifacts-name }}
36+
37+
- name: Check Fetch Bundle Artifacts
38+
id: check-artifact
39+
shell: bash
40+
run: |
41+
if [ -d "dist" ] && [ "$(ls -A dist)" ]; then
42+
echo "artifacts_present=true" >> $GITHUB_ENV
43+
else
44+
echo "artifacts_present=false" >> $GITHUB_ENV
45+
fi
46+
47+
- name: Fail Fetch Bundle Artifacts
48+
if: ${{ inputs.operation == 'fetch' && env.artifacts_present == 'false' }}
49+
shell: bash
50+
run: |
51+
echo "No artifacts found for the current commit. Please run the workflow with 'build' operation first."
52+
exit 1
53+
54+
- name: Bundle Action
55+
if: ${{ inputs.operation == 'build' && env.artifacts_present == 'false' }}
56+
shell: bash
57+
run: npm run bundle
58+
59+
- name: Upload Bundle Artifacts
60+
if: ${{ inputs.operation == 'build' && env.artifacts_present == 'false' }}
61+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
62+
with:
63+
name: ${{ env.bundle-artifacts-name }}
64+
path: |
65+
action.yml
66+
dist/
67+
retention-days: 1

0 commit comments

Comments
 (0)