
* WIP refactor of login tests * Xit not woriking tests, fixed rest of them * Properly pass env vars to cypress * Remove unused code Co-authored-by: Krzysztof Wolski <krzysztof.k.wolski@gmail.com>
122 lines
3.1 KiB
YAML
122 lines
3.1 KiB
YAML
name: QA
|
|
|
|
on:
|
|
pull_request:
|
|
branches: ["*"]
|
|
|
|
jobs:
|
|
check-lock:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Validate lock file
|
|
run: |
|
|
npx lockfile-lint --path package-lock.json --allowed-hosts npm yarn
|
|
|
|
tsc-and-linters:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Cache node modules
|
|
uses: actions/cache@v2
|
|
env:
|
|
cache-name: cache-node-modules
|
|
with:
|
|
# npm cache files are stored in `~/.npm` on Linux/macOS
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-qa-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-qa-${{ env.cache-name }}-
|
|
${{ runner.os }}-qa-
|
|
${{ runner.os }}-
|
|
|
|
- name: Install deps
|
|
run: |
|
|
npm ci
|
|
|
|
- name: Run tsc
|
|
run: |
|
|
npm run check-types
|
|
|
|
- name: Run lint
|
|
run: |
|
|
npm run lint
|
|
git diff --exit-code ./src
|
|
|
|
jest-tests:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Cache node modules
|
|
uses: actions/cache@v2
|
|
env:
|
|
cache-name: cache-node-modules
|
|
with:
|
|
# npm cache files are stored in `~/.npm` on Linux/macOS
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-qa-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-qa-${{ env.cache-name }}-
|
|
${{ runner.os }}-qa-
|
|
${{ runner.os }}-
|
|
|
|
- name: Install deps
|
|
run: |
|
|
npm ci
|
|
|
|
- name: Run jest
|
|
run: |
|
|
npm run test
|
|
|
|
cypress-run:
|
|
runs-on: ubuntu-16.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v1
|
|
- name: Cypress run
|
|
uses: cypress-io/github-action@v2
|
|
env:
|
|
API_URI: ${{ secrets.API_URI }}
|
|
APP_MOUNT_URI: ${{ secrets.APP_MOUNT_URI }}
|
|
CYPRESS_USER_NAME: ${{ secrets.CYPRESS_USER_NAME }}
|
|
CYPRESS_USER_PASSWORD: ${{ secrets.CYPRESS_USER_PASSWORD }}
|
|
with:
|
|
build: npm run build
|
|
start: npx http-server -a localhost -p 9000 build/dashboard
|
|
wait-on: http://localhost:9000/
|
|
wait-on-timeout: 120
|
|
- uses: actions/upload-artifact@v1
|
|
if: always()
|
|
with:
|
|
name: cypress-videos
|
|
path: cypress/videos
|
|
|
|
translation-messages:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Cache node modules
|
|
uses: actions/cache@v2
|
|
env:
|
|
cache-name: cache-node-modules
|
|
with:
|
|
# npm cache files are stored in `~/.npm` on Linux/macOS
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-qa-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-qa-${{ env.cache-name }}-
|
|
${{ runner.os }}-qa-
|
|
${{ runner.os }}-
|
|
|
|
- name: Install deps
|
|
run: |
|
|
npm ci
|
|
|
|
- name: Check message extraction
|
|
run: |
|
|
npm run extract-messages
|
|
git diff --exit-code ./locale
|