[ACA-4649] GHA linting and unit testing support (#2904)

* GHA linting support

* gha: aos tests

* fix test job

* gha: aca-shared test

* gha: unit tests for the rest of the projects

* upgrade CodeQL actions

* remove obsolete action settings
This commit is contained in:
Denys Vuika 2023-01-14 17:14:31 +00:00 committed by GitHub
parent 561e9ac970
commit b50c4e993d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 119 additions and 9 deletions

View File

@ -16,20 +16,15 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
# Override language selection by uncommenting this and choosing your languages
with:
languages: javascript
@ -37,7 +32,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@ -51,4 +46,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2

115
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,115 @@
name: Test
on:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]
jobs:
lint:
name: 'Lint'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: node
uses: actions/setup-node@v3
with:
node-version: 14
cache: 'npm'
- run: npm ci
- run: npm run lint
test-aca-content:
needs: lint
name: aca-content
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: node
uses: actions/setup-node@v3
with:
node-version: 14
cache: 'npm'
- run: npm ci
- run: npm test aca-content -- --browsers=ChromeHeadless --watch=false
test-aos:
needs: lint
name: adf-office-services-ext
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: node
uses: actions/setup-node@v3
with:
node-version: 14
cache: 'npm'
- run: npm ci
- run: npm test adf-office-services-ext -- --browsers=ChromeHeadless --watch=false
test-aca-shared:
needs: lint
name: aca-shared
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: node
uses: actions/setup-node@v3
with:
node-version: 14
cache: 'npm'
- run: npm ci
- run: npm test aca-shared -- --browsers=ChromeHeadless --watch=false
test-aca-settings:
needs: lint
name: aca-settings
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: node
uses: actions/setup-node@v3
with:
node-version: 14
cache: 'npm'
- run: npm ci
- run: npm test aca-settings -- --browsers=ChromeHeadless --watch=false
test-aca-folder-rules:
needs: lint
name: aca-folder-rules
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: node
uses: actions/setup-node@v3
with:
node-version: 14
cache: 'npm'
- run: npm ci
- run: npm test aca-folder-rules -- --browsers=ChromeHeadless --watch=false