Merge pull request 'testing ci using external forgejo runner' (#84) from forgejo-workflows into main
Reviewed-on: #84
This commit was merged in pull request #84.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
name: Format (JS/TS)
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
format:
|
||||
runs-on: alpine
|
||||
container: node:20-alpine
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install tools
|
||||
run: |
|
||||
apk add --no-cache \
|
||||
git
|
||||
|
||||
- name: Prettier
|
||||
run: |
|
||||
if [ -n "$(find . \( -iname "*.js" -o -iname "*.jsx" -o -iname "*.ts" -o -iname "*.tsx" -o -iname "*.mjs" -o -iname "*.cjs" \) -print -quit)" ]; then
|
||||
npx --yes prettier --check "**/*.{js,jsx,ts,tsx,mjs,cjs}" --ignore-path .gitignore
|
||||
else
|
||||
echo "No JS/TS files found"
|
||||
fi
|
||||
@@ -0,0 +1,33 @@
|
||||
name: Lint (JS/TS)
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: alpine
|
||||
container: node:20-alpine
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install tools
|
||||
run: |
|
||||
apk add --no-cache \
|
||||
git
|
||||
|
||||
- name: ESLint
|
||||
run: |
|
||||
if [ -n "$(find . \( -iname "*.js" -o -iname "*.jsx" -o -iname "*.ts" -o -iname "*.tsx" -o -iname "*.mjs" -o -iname "*.cjs" \) -print -quit)" ]; then
|
||||
if [ -f package.json ]; then
|
||||
npm install --no-audit --no-fund
|
||||
fi
|
||||
if [ -f eslint.config.js ] || [ -f eslint.config.mjs ] || [ -f eslint.config.cjs ] || [ -f .eslintrc ] || [ -f .eslintrc.js ] || [ -f .eslintrc.cjs ] || [ -f .eslintrc.json ] || [ -f .eslintrc.yaml ] || [ -f .eslintrc.yml ]; then
|
||||
npx --yes eslint .
|
||||
else
|
||||
echo "No eslint config found"
|
||||
fi
|
||||
else
|
||||
echo "No JS/TS files found"
|
||||
fi
|
||||
@@ -0,0 +1,27 @@
|
||||
name: Lint (Python)
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: alpine
|
||||
container: node:20-alpine
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install tools
|
||||
run: |
|
||||
apk add --no-cache \
|
||||
git \
|
||||
python3 \
|
||||
py3-pip
|
||||
|
||||
- name: Ruff
|
||||
run: |
|
||||
python3 -m venv .venv
|
||||
. .venv/bin/activate
|
||||
pip install --no-cache-dir ruff
|
||||
ruff check .
|
||||
@@ -0,0 +1,27 @@
|
||||
name: Lint (Rust)
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: alpine
|
||||
container: node:20-alpine
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install tools
|
||||
run: |
|
||||
apk add --no-cache \
|
||||
git \
|
||||
rust
|
||||
|
||||
- name: Rustfmt
|
||||
run: |
|
||||
if [ -f Cargo.toml ]; then
|
||||
cargo fmt --check
|
||||
else
|
||||
echo "No Rust project found"
|
||||
fi
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"semi": true,
|
||||
"singleQuote": true,
|
||||
"jsxSingleQuote": false,
|
||||
"tabWidth": 4,
|
||||
"printWidth": 100,
|
||||
"trailingComma": "es5",
|
||||
"bracketSpacing": true,
|
||||
"bracketSameLine": false,
|
||||
"arrowParens": "always",
|
||||
"endOfLine": "lf",
|
||||
"proseWrap": "preserve"
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
export default [
|
||||
{
|
||||
files: ["**/*.{js,jsx,ts,tsx,mjs,cjs}"],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2021,
|
||||
sourceType: "module"
|
||||
},
|
||||
linterOptions: {
|
||||
reportUnusedDisableDirectives: true
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
];
|
||||
Reference in New Issue
Block a user