Generalize template CI for standard actions
All checks were successful
CI / smoke (push) Successful in 33s
All checks were successful
CI / smoke (push) Successful in 33s
This commit is contained in:
@@ -12,7 +12,57 @@ jobs:
|
||||
runs-on: linux-amd64
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: http://debian.hellosu.top:3000/actions/checkout@v4
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Detect project files
|
||||
id: detect
|
||||
run: |
|
||||
if [ -f package.json ]; then
|
||||
echo "node=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "node=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
if [ -f pyproject.toml ] || [ -f requirements.txt ]; then
|
||||
echo "python=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "python=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Setup Node.js
|
||||
if: steps.detect.outputs.node == 'true'
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 24
|
||||
|
||||
- name: Install Node.js dependencies
|
||||
if: steps.detect.outputs.node == 'true'
|
||||
run: |
|
||||
if [ -f package-lock.json ]; then
|
||||
npm ci --ignore-scripts
|
||||
else
|
||||
npm install --ignore-scripts
|
||||
fi
|
||||
|
||||
- name: Lint Node.js project
|
||||
if: steps.detect.outputs.node == 'true'
|
||||
run: npm run lint --if-present
|
||||
|
||||
- name: Build Node.js project
|
||||
if: steps.detect.outputs.node == 'true'
|
||||
run: npm run build --if-present
|
||||
|
||||
- name: Setup Python
|
||||
if: steps.detect.outputs.python == 'true'
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Show Python environment
|
||||
if: steps.detect.outputs.python == 'true'
|
||||
run: |
|
||||
python --version
|
||||
python -m pip --version
|
||||
|
||||
- name: Show workspace
|
||||
run: |
|
||||
@@ -24,6 +74,5 @@ jobs:
|
||||
|
||||
- name: Validate template files
|
||||
run: |
|
||||
test -f README.md
|
||||
test -f .editorconfig
|
||||
test -f .gitea/workflows/ci.yml
|
||||
|
||||
Reference in New Issue
Block a user