mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
137 lines
3.3 KiB
YAML
137 lines
3.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
tags:
|
|
- v*
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 14.x
|
|
- run: npm ci --ignore-scripts
|
|
- run: npm run lint
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version:
|
|
- 12.x
|
|
- 14.x
|
|
env:
|
|
TEST_DOCKER: true
|
|
services:
|
|
sparql-endpoint:
|
|
image: tenforce/virtuoso
|
|
env:
|
|
SPARQL_UPDATE: true
|
|
ports:
|
|
- 4000:8890
|
|
steps:
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- name: Check out repository
|
|
uses: actions/checkout@v2
|
|
- name: Install dependencies
|
|
run: npm ci --ignore-scripts
|
|
- name: Run build scripts
|
|
run: npm run build
|
|
- name: Validate components files
|
|
run: npm run validate
|
|
- name: Type-check tests
|
|
run: npm run test:ts
|
|
- name: Run unit tests
|
|
run: npm run test:unit
|
|
- name: Submit unit test coverage
|
|
uses: coverallsapp/github-action@master
|
|
with:
|
|
github-token: ${{ secrets.github_token }}
|
|
flag-name: run-${{ matrix.node-version }}
|
|
parallel: true
|
|
- name: Run integration tests
|
|
run: npm run test:integration
|
|
- name: Run deployment tests
|
|
run: npm run test:deploy
|
|
|
|
test-windows:
|
|
runs-on: windows-latest
|
|
strategy:
|
|
matrix:
|
|
node-version:
|
|
- 12.x
|
|
- 14.x
|
|
steps:
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- name: Ensure line endings are consistent
|
|
run: git config --global core.autocrlf input
|
|
- name: Check out repository
|
|
uses: actions/checkout@v2
|
|
- name: Install dependencies
|
|
run: npm ci --ignore-scripts
|
|
- name: Run build scripts
|
|
run: npm run build
|
|
- name: Run unit tests
|
|
run: npm run test:unit
|
|
- name: Run integration tests
|
|
run: npm run test:integration
|
|
- name: Run deployment tests
|
|
run: npm run test:deploy
|
|
|
|
coveralls:
|
|
needs: test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Consolidate test coverage from different jobs
|
|
uses: coverallsapp/github-action@master
|
|
with:
|
|
github-token: ${{ secrets.github_token }}
|
|
parallel-finished: true
|
|
|
|
docs:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 14.x
|
|
- run: npm ci --ignore-scripts
|
|
- run: npm run docs
|
|
- name: Save docs
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: docs
|
|
path: docs
|
|
retention-days: 1
|
|
|
|
publish-docs:
|
|
needs:
|
|
- docs
|
|
- lint
|
|
- test
|
|
runs-on: ubuntu-latest
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
steps:
|
|
- uses: actions/download-artifact@v2
|
|
with:
|
|
name: docs
|
|
path: docs
|
|
- uses: peaceiris/actions-gh-pages@v3
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: .
|