Skip to content

Commit

Permalink
ci: define test plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
oplik0 committed Aug 5, 2023
1 parent 8f61cdf commit 0b825a5
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,18 @@ jobs:
- uses: actions/checkout@v3
with:
path: tested-plugin
- run: cp install/package.json package.json
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Get plugin name
id: pluginName
run: echo "NAME=$(node -e "console.log(require('./tested-plugin/package.json').name)")" >> "$GITHUB_OUTPUT"
- run: cp install/package.json package.json
- name: Install dependencies
run: npm install
- name: Install tested plugin
run: npm install --save ./tested-plugin
- name: Setup on MongoDB
if: startsWith(matrix.database, 'mongo')
env:
Expand All @@ -85,7 +91,10 @@ jobs:
"mongo:port": 27017,
"mongo:username": "",
"mongo:password": "",
"mongo:database": "nodebb"
"mongo:database": "nodebb",
"test_plugins": [
"${{ steps.pluginName.outputs.NAME }}"
]
}
CI: >-
{
Expand All @@ -112,7 +121,10 @@ jobs:
"postgres:port": 5432,
"postgres:username": "postgres",
"postgres:password": "postgres",
"postgres:database": "nodebb"
"postgres:database": "nodebb",
"test_plugins": [
"${{ steps.pluginName.outputs.NAME }}"
]
}
CI: >-
{
Expand Down Expand Up @@ -142,7 +154,10 @@ jobs:
"redis:host": "127.0.0.1",
"redis:port": 6379,
"redis:password": "",
"redis:database": 0
"redis:database": 0,
"test_plugins": [
"${{ steps.pluginName.outputs.NAME }}"
]
}
CI: >-
{
Expand All @@ -152,11 +167,6 @@ jobs:
}
run: |
node app --setup="${SETUP}" --ci="${CI}"
- name: Install tested plugin
run: npm install --save ./tested-plugin
- name: Activate tested plugin
run: |
./nodebb activate $(node -e "console.log(require('./tested-plugin/package.json').name)")
- name: Run ESLint
if: matrix.lint
run: npm run lint
Expand Down

0 comments on commit 0b825a5

Please sign in to comment.