From 67a8e1d3309d2bbea1a5b9e76e2f7589d040824e Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 5 Oct 2021 07:46:02 +0300 Subject: [PATCH] Update CI config * specify `FORCE_COLOR:2` so that we get colored output * specify `fail-fast: false` * switch to the actions tags when possible * reindent --- .github/workflows/release.yml | 45 ++++++++++++++++++----------------- .github/workflows/test.yml | 28 ++++++++++++---------- 2 files changed, 39 insertions(+), 34 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a120361..0a16dc0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,30 +8,31 @@ on: required: true env: - node_version: 14 + NODE_VERSION: 14 + FORCE_COLOR: 2 jobs: version_and_release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.3.4 - with: - # fetch full history so things like auto-changelog work properly - fetch-depth: 0 - - name: Use Node.js ${{ env.node_version }} - uses: actions/setup-node@v2.4.1 - with: - node-version: ${{ env.node_version }} - # setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token. REQUIRED - registry-url: 'https://registry.npmjs.org' - - run: npm i - - run: git status # getting odd dirty repo errors during version debug info - - run: git diff - - name: npm version && npm publish - uses: bcomnes/npm-bump@v2.0.2 - with: - git_email: bcomnes@gmail.com - git_username: ${{ github.actor }} - newversion: ${{ github.event.inputs.newversion }} - github_token: ${{ secrets.GITHUB_TOKEN }} # built in actions token. Passed tp gh-release if in use. - npm_token: ${{ secrets.NPM_TOKEN }} # user set secret token generated at npm + - uses: actions/checkout@v2 + with: + # fetch full history so things like auto-changelog work properly + fetch-depth: 0 + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v2 + with: + node-version: ${{ env.NODE_VERSION }} + # setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token. REQUIRED + registry-url: 'https://registry.npmjs.org' + - run: npm i + - run: git status # getting odd dirty repo errors during version debug info + - run: git diff + - name: npm version && npm publish + uses: bcomnes/npm-bump@v2 + with: + git_email: bcomnes@gmail.com + git_username: ${{ github.actor }} + newversion: ${{ github.event.inputs.newversion }} + github_token: ${{ secrets.GITHUB_TOKEN }} # built in actions token. Passed tp gh-release if in use. + npm_token: ${{ secrets.NPM_TOKEN }} # user set secret token generated at npm diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 037d09e..a26d710 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,27 +2,31 @@ name: tests on: [pull_request, push] +env: + FORCE_COLOR: 2 + jobs: test: runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest] node: [14, 12] steps: - - uses: actions/checkout@v2.3.4 - - name: Use Node.js ${{ matrix.node }} - uses: actions/setup-node@v2.4.1 - with: - node-version: ${{ matrix.node }} - - run: npm i - - run: npm test - - uses: codecov/codecov-action@v2.1.0 - if: ${{ github.event_name == 'pull_request' }} - with: - flags: ${{ matrix.os }}-${{ matrix.node }} + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + - run: npm i + - run: npm test + - uses: codecov/codecov-action@v2 + if: ${{ github.event_name == 'pull_request' }} + with: + flags: ${{ matrix.os }}-${{ matrix.node }} automerge: needs: test @@ -31,4 +35,4 @@ jobs: - uses: fastify/github-action-merge-dependabot@v2.5.0 if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' && contains(github.head_ref, 'dependabot/github_actions') }} with: - github-token: ${{secrets.github_token}} + github-token: ${{ secrets.github_token }}