Skip to content

Feature testing deploy #267

Feature testing deploy

Feature testing deploy #267

Workflow file for this run

name: Code Check
on:
pull_request:
branches:
- 'main'
types:
- opened
- synchronize
- reopened
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
setup:
name: 'Setup Application'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.16.0'
- name: Step 0 - πŸ“ Cache node modules
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: Step 1 - βš™οΈ Install Dependencies
run: npm install
validate_linters_and_code_format:
needs: setup
name: 'Validate Linters and Code Format'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.16.0'
- name: Step 0 - πŸ“ Cache node modules
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Step 1 - πŸ§ͺ Run eslint linter
run: npm run eslint:check
- name: Step 2 - πŸ§ͺπŸ§ͺ Run prettier
run: npm run prettier:check
validate_tests:
needs: validate_linters_and_code_format
name: 'Run tests'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.16.0'
- name: Step 0 - πŸ“ Cache node modules
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Step 1 - πŸ§ͺ Run tests
run: npm run test
# validate_build:
# needs: validate_tests
# name: 'Run build'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: '20.16.0'
# - name: Step 0 - πŸ“ Cache node modules
# id: cache-npm
# uses: actions/cache@v4
# env:
# cache-name: cache-node-modules
# with:
# path: |
# ~/.npm
# node_modules
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# - name: Step 1 - πŸ§ͺ Build project
# run: npm run build