mirror of
https://github.com/firstsun-dev/git-files-sync.git
synced 2026-07-22 17:20:30 +00:00
46 lines
1.1 KiB
YAML
46 lines
1.1 KiB
YAML
name: Reusable Check
|
|
|
|
on:
|
|
workflow_call:
|
|
outputs:
|
|
version:
|
|
description: "The version from manifest.json"
|
|
value: ${{ jobs.check.outputs.version }}
|
|
|
|
jobs:
|
|
check:
|
|
name: Lint, Test, and Build
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
version: ${{ steps.version.outputs.version }}
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run linter
|
|
run: npm run lint
|
|
|
|
- name: Run tests with coverage
|
|
run: npm run test -- --coverage
|
|
|
|
- name: Build plugin
|
|
run: npm run build
|
|
|
|
- name: Check build artifacts
|
|
run: |
|
|
if [ ! -f main.js ]; then exit 1; fi
|
|
if [ ! -f manifest.json ]; then exit 1; fi
|
|
if [ ! -f styles.css ]; then exit 1; fi
|
|
|
|
- name: Get version from manifest
|
|
id: version
|
|
run: echo "version=$(node -p "require('./manifest.json').version")" >> $GITHUB_OUTPUT
|