name: 'Test' on: pull_request: types: [opened, synchronize] paths-ignore: - '**.md' push: paths-ignore: - '**.md' branches: - master jobs: test: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - name: Read .nvmrc run: echo "::set-output name=NVMRC::$(cat .nvmrc)" id: nvm - name: Setup Node uses: actions/setup-node@v1 with: node-version: '${{ steps.nvm.outputs.NVMRC }}' - name: Cache uses: actions/cache@v1 with: path: ~/.npm key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-node- - run: npm ci - run: npm run format:check - run: npm run lint - run: npm test - name: Check ncc run: | npm run build test -z "$(git status --short)" - name: Upload test coverage uses: actions/upload-artifact@v1 with: name: coverage path: coverage test-prod: runs-on: ${{ matrix.os }} needs: test strategy: matrix: os: ['ubuntu-18.04', 'macos-latest', 'windows-latest'] hugo-version: ['latest', '0.57.2'] extended: [true, false] steps: - uses: actions/checkout@v2 - name: Test action uses: ./ with: hugo-version: ${{ matrix.hugo-version }} extended: ${{ matrix.extended }}