diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bab6830..781cdf0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,5 @@ name: Frontend CI + on: push: branches: @@ -7,19 +8,75 @@ on: pull_request: branches: - master + jobs: - build: + install-dependencies: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: '20.x' + node-version-file: '.nvmrc' + cache: 'npm' + - name: Cache node_modules + uses: actions/cache@v4 + id: cache-primes + with: + path: node_modules + key: ${{ runner.os }}-npm-v3-${{ hashFiles('package-lock.json') }} - name: Install dependencies run: npm ci + + type-check: + runs-on: ubuntu-latest + needs: install-dependencies + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'npm' + - name: Load cached node_modules + uses: actions/cache@v4 + id: cache-primes + with: + path: node_modules + key: ${{ runner.os }}-npm-v3-${{ hashFiles('package-lock.json') }} - name: Check TypeScript run: npm run type-check + + style-check: + runs-on: ubuntu-latest + needs: install-dependencies + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'npm' + - name: Load cached node_modules + uses: actions/cache@v4 + id: cache-primes + with: + path: node_modules + key: ${{ runner.os }}-npm-v3-${{ hashFiles('package-lock.json') }} - name: Run Prettier run: npm run style-check + + test: + runs-on: ubuntu-latest + needs: install-dependencies + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'npm' + - name: Load cached node_modules + uses: actions/cache@v4 + id: cache-primes + with: + path: node_modules + key: ${{ runner.os }}-npm-v3-${{ hashFiles('package-lock.json') }} - name: Run tests - run: npm run test:ci \ No newline at end of file + run: npm run test:ci