name: nodejs on: push: branches: - master - "greenkeeper/*" pull_request: types: [opened, synchronize] jobs: node-engine-check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 with: fetch-depth: 1 - name: Use Node.js 8 uses: actions/setup-node@v1 with: node-version: 8 - run: npm install --production --no-package-lock build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 with: fetch-depth: 1 - name: setup yarn-cache id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" - name: cache yarn global cache if: runner.os != 'macos-latest' uses: actions/cache@v1 with: path: ${{ steps.yarn-cache.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn- - run: yarn - run: yarn lint - run: yarn build - name: upload dist folder uses: actions/upload-artifact@v1 with: name: dist path: dist test: runs-on: ${{ matrix.os }} needs: build strategy: matrix: os: ['ubuntu-latest'] node-version: [10, 12, 14] steps: - uses: actions/checkout@v1 with: fetch-depth: 1 - name: setup yarn-cache id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - name: cache yarn global cache if: runner.os != 'macos-latest' uses: actions/cache@v1 with: path: ${{ steps.yarn-cache.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn- - run: yarn --ignore-engines - run: yarn coverage # - name: codecov # if: matrix.node-version == 12 && matrix.os == 'ubuntu-latest' # uses: codecov/codecov-action@v1 # with: # token: ${{ secrets.CODECOV_TOKEN }} # - name: codacy # if: matrix.node-version == 12 && matrix.os == 'ubuntu-latest' # uses: codacy/codacy-coverage-reporter-action@master # with: # project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} release: name: release runs-on: ubuntu-latest if: github.ref == 'refs/heads/master' needs: - build - test steps: - uses: actions/checkout@v1 - name: setup yarn-cache id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" - name: cache yarn global cache uses: actions/cache@v1 with: path: ${{ steps.yarn-cache.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn- - name: download dist folder uses: actions/download-artifact@v1 with: name: dist - run: yarn - run: yarn semantic-release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }}