Updated stubs and unit testing #29
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
name: Sanity checks | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopend | |
jobs: | |
linting: | |
name: Static analysis with ESLint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Code Checkout | |
uses: actions/checkout@v3 | |
- name: Install translation tools | |
run: sudo apt-get install -y make gettext | |
- name: Install NodeJS 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'yarn' | |
- name: Install the dependencies | |
run: yarn install --frozen-lockfile | |
- name: Analyse source code with ESLint | |
run: yarn lint | |
building: | |
name: Packaging | |
runs-on: ubuntu-latest | |
steps: | |
- name: Code Checkout | |
uses: actions/checkout@v3 | |
- name: Install translation tools | |
run: sudo apt-get install -y make gettext | |
- name: Install NodeJS 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'yarn' | |
- name: Install the dependencies | |
run: yarn install --frozen-lockfile | |
- name: Build the extension zip from the TypeScript sources | |
run: yarn package | |
- name: Upload the distributable package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: extension-archive | |
path: build/dist/**/* | |
testing: | |
name: Unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Code Checkout | |
uses: actions/checkout@v3 | |
- name: Install translation tools | |
run: sudo apt-get install -y make gettext | |
- name: Install NodeJS 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'yarn' | |
- name: Install the dependencies | |
run: yarn install --frozen-lockfile | |
- name: Ruinning the test suite | |
run: yarn test | |
- name: Upload test coverage report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-report | |
path: build/test/lcov.info | |
sonarcloud: | |
name: Static analysis with SonarCloud | |
runs-on: ubuntu-latest | |
needs: testing | |
steps: | |
- name: Code Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Download test coverage report | |
uses: actions/download-artifact@v3 | |
with: | |
name: coverage-report | |
path: build/test | |
- name: Perform SonarCloud Scan | |
uses: SonarSource/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |