๐๏ธ Add guildDB #390
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
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | |
name: Build | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
prepare: | |
name: Find paths | |
runs-on: ubuntu-latest | |
outputs: | |
paths: ${{ steps.paths.outputs.paths }} | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@v4 | |
- uses: actions/github-script@v7 | |
name: List paths | |
id: paths | |
with: | |
script: | | |
const fs = require('fs') | |
const path = require('path') | |
const process = require('process') | |
const pathName = path.join(process.cwd(), 'plugins') | |
const files = fs.readdirSync(pathName) | |
const directories = files.filter((file) => fs.statSync(path.join(pathName, file)).isDirectory()).map((dir) => `plugins/${dir}`) | |
directories.push('core') | |
core.setOutput('paths', directories) | |
build: | |
name: Build ${{ matrix.path }} | |
runs-on: ubuntu-latest | |
needs: prepare | |
strategy: | |
matrix: | |
node-version: [20.x] | |
path: ${{ fromJson(needs.prepare.outputs.paths) }} | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
check-latest: true | |
- run: | | |
cd ${{ matrix.path }} && | |
npm ci && | |
npm run build --if-present |