Merge branch 'master' of github.com:atlas-bi/System #158
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: π§ͺ Test | |
on: | |
push: | |
branches: | |
- master | |
- alpha | |
- dev | |
pull_request: {} | |
permissions: | |
actions: write | |
contents: read | |
jobs: | |
shell: | |
name: β ShellCheck | |
runs-on: ubuntu-latest | |
steps: | |
- name: π Cancel Previous Runs | |
uses: styfle/[email protected] | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v3 | |
- name: β Setup ShellCheck | |
run: sudo apt-get update; sudo apt-get install -y shellcheck | |
- name: π¬ Lint | |
run: | | |
cd packages | |
shellcheck **/*.sh | |
shellcheck **/atlas-requests | |
shellcheck **/install | |
shellcheck **/postinst | |
shellcheck **/preinst | |
lint: | |
name: ⬣ ESLint | |
runs-on: ubuntu-latest | |
steps: | |
- name: π Cancel Previous Runs | |
uses: styfle/[email protected] | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v3 | |
- name: β Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: π₯ Download deps | |
uses: bahmutov/npm-install@v1 | |
with: | |
useLockFile: false | |
- name: π¬ Lint | |
run: npm run lint | |
typecheck: | |
name: Κ¦ TypeScript | |
runs-on: ubuntu-latest | |
steps: | |
- name: π Cancel Previous Runs | |
uses: styfle/[email protected] | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v3 | |
- name: β Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: π₯ Download deps | |
uses: bahmutov/npm-install@v1 | |
with: | |
useLockFile: false | |
- name: π Type check | |
run: npm run typecheck --if-present | |
vitest: | |
name: β‘ Vitest | |
runs-on: ubuntu-latest | |
steps: | |
- name: π Cancel Previous Runs | |
uses: styfle/[email protected] | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v3 | |
- name: β Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: π₯ Download deps | |
uses: bahmutov/npm-install@v1 | |
with: | |
useLockFile: false | |
- name: β‘ Run vitest | |
run: npm run test -- --coverage | |
cypress: | |
name: β«οΈ Cypress | |
runs-on: ubuntu-latest | |
steps: | |
- name: π Cancel Previous Runs | |
uses: styfle/[email protected] | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v3 | |
- name: π Copy test env vars | |
run: cp .env.example .env | |
- name: β Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: π₯ Download deps | |
uses: bahmutov/npm-install@v1 | |
with: | |
useLockFile: false | |
- name: π³ Docker compose | |
# the sleep is just there to give time for postgres to get started | |
run: docker-compose up -d && sleep 3 | |
env: | |
DATABASE_URL: 'postgresql://postgres:postgres@localhost:5432/postgres' | |
- name: π Setup Database | |
run: npx prisma migrate reset --force | |
- name: βοΈ Build | |
run: npm run build | |
- name: π³ Cypress run | |
uses: cypress-io/github-action@v5 | |
with: | |
start: npm run start:mocks | |
wait-on: 'http://localhost:8811' | |
env: | |
PORT: '8811' |