ci: fix workflow syntax #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | ||
workflow_call: | ||
secrets: | ||
GITHUB_TOKEN: | ||
required: true | ||
NPM_TOKEN: | ||
required: true | ||
jobs: | ||
staticAnalysis: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '22' | ||
registry-url: 'https://registry.npmjs.org' | ||
cache: 'npm' | ||
- name: Install | ||
run: npm ci | ||
- name: Test | ||
run: | | ||
npm run format-check | ||
npm run lint-check | ||
npm run tsc | ||
integrationTests: | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
fetch-depth: 1 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '22' | ||
registry-url: 'https://registry.npmjs.org' | ||
cache: 'npm' | ||
- name: Install | ||
run: npm ci | ||
- name: Tests | ||
run: | | ||
git config --global user.name "libdragon-cli" | ||
git config --global user.email "cli@libdragon.dev" | ||
npm run test | ||
buildExecutables: | ||
strategy: | ||
matrix: | ||
runs-on: [ubuntu-latest, macos-latest, windows-latest] | ||
runs-on: ${{ matrix.runs-on }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '22' | ||
registry-url: 'https://registry.npmjs.org' | ||
cache: 'npm' | ||
- name: Install | ||
run: npm ci | ||
- name: Get next version | ||
id: next_release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
shell: bash | ||
run: npx semantic-release --dry-run --no-ci | ||
- name: Build | ||
run: npm run pack ${{ steps.next_release.outputs.version }} | ||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: executable-${{ matrix.runs-on }} | ||
path: build/libdragon* |