Skip to content

ci: create cache node in workflow pipelines #53

ci: create cache node in workflow pipelines

ci: create cache node in workflow pipelines #53

Workflow file for this run

name: CI
on:
push:
branches:
- '*'
- '*/*'
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
env:
CI_DEPENDENCIES: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

Check failure on line 17 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / CI

Invalid workflow file

The workflow is not valid. .github/workflows/ci.yml (Line: 17, Col: 24): Unrecognized named-value: 'runner'. Located at position 1 within expression: runner.os
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Cache Node.js dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: 16.20.2
- name: Install dependencies
run: npm install --force
- name: Build of code
run: npm run build
- name: Set build status
run: echo "build_status=${{ job.status }}" >> $GITHUB_ENV
- name: Check build status
run: exit 1
if: ${{ success() == false }}
- name: Run unit tests
id: unit-tests
run: |
if npm run test:ci; then
echo "AWESOME UNIT TEST IS PASSED !"
echo "unit_test_status=success" >> $GITHUB_ENV
else
echo "PLEASE BE AWARE TEST HAS BEEN FAILED !"
echo "unit_test_status=failure" >> $GITHUB_ENV
fi
- name: Check test status
run: exit 1
if: ${{ steps.unit-tests.outputs.unit_test_status == 'failure' }}