name: Verify Source on: [pull_request, push] jobs: build: name: Build package runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Use Node.js 12.x uses: actions/setup-node@v2 with: node-version: 12.x - name: Cache dependencies uses: actions/cache@v2 with: path: ~/.npm key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-node- - name: Install dependencies run: npm ci - name: Build NodeJS package run: npm run build lint: name: Lint runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Use Node.js 12.x uses: actions/setup-node@v2 with: node-version: 12.x - name: Cache dependencies uses: actions/cache@v2 with: path: ~/.npm key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-node- - name: Install dependencies run: npm ci - name: Run linter run: npm run lint test: name: Test package runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Use Node.js 12.x uses: actions/setup-node@v2 with: node-version: 12.x - name: Cache dependencies uses: actions/cache@v2 with: path: ~/.npm key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-node- - name: Cache Jest uses: actions/cache@v2 with: path: .cache/jest key: ${{ runner.os }}-jest-${{ hashFiles('package-lock.json') }}-${{ github.run_number }} restore-keys: | ${{ runner.os }}-jest-${{ hashFiles('package-lock.json') }}- ${{ runner.os }}-jest- - name: Install dependencies run: npm ci - name: Run tests run: npm run test