Skip to content

chore(deps): update dependency eslint-plugin-jest to v27.5.0 (#185) #1057

chore(deps): update dependency eslint-plugin-jest to v27.5.0 (#185)

chore(deps): update dependency eslint-plugin-jest to v27.5.0 (#185) #1057

Workflow file for this run

---
name: CI
'on':
pull_request:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
jobs:
setup:
name: Setup
outputs:
dist-changed: ${{ steps.filter.outputs.dist-changed }}
node-version: ${{ steps.set-node-version.outputs.node-version }}
should-lint: ${{ steps.filter.outputs.should-lint }}
src-changed: ${{ steps.filter.outputs.src-changed }}
permissions:
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- env:
NODE_VERSION: 18.18.2 # renovate: datasource=node depName=node
id: set-node-version
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
cache: yarn
node-version: ${{ env.NODE_VERSION }}
- id: filter
uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
with:
filters: |
config: &config
- .github/**
- jest.config.js
- '**.json5?'
- '**.md'
- '**.ya?ml'
dist-changed:
- added|modified: 'dist/**'
src-changed: &src-changed
- __tests__/**
- src/**
- .yarnrc.yml
- action.ya?ml
- package.json
should-lint:
- added|modified: *config
- added|modified: *src-changed
list-files: json
lint:
if: ${{ needs.setup.outputs.should-lint == 'true' }}
name: Lint
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Node.js
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
cache: yarn
node-version: ${{ needs.setup.outputs.node-version }}
- run: yarn install --immutable
- run: yarn check-format
- run: yarn lint
build:
if: ${{ needs.setup.outputs.src-changed == 'true' }}
name: Build
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Node.js
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
cache: yarn
node-version: ${{ needs.setup.outputs.node-version }}
- name: Install dependencies
run: yarn install --immutable
- name: Rebuild the dist/ directory
run: yarn build
- if: ${{ needs.setup.outputs.dist-changed == 'true' }}
name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff --text
exit 1
fi
id: diff
# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: dist/
test:
name: Test
needs: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Node.js
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
cache: yarn
node-version: ${{ needs.setup.outputs.node-version }}
- name: Install dependencies
run: yarn install --immutable
- run: yarn test
- name: Setup Node.js for integration tests
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version: 16
- uses: ./
with:
milliseconds: 1000
release:
env:
DRY_RUN: ${{ github.ref_name != github.event.repository.default_branch }}
FORCE_COLOR: true
name: Release
needs: [setup, lint, test]
runs-on: ubuntu-latest
steps:
- id: get-workflow-access-token
name: Get Workflow Access Token
uses: peter-murray/workflow-application-token-action@8e1ba3bf1619726336414f1014e37f17fbadf1db # v2.1.0
with:
application_id: ${{ secrets.APPLICATION_ID }}
application_private_key: ${{ secrets.APPLICATION_PRIVATE_KEY }}
permissions: 'contents:write, issues:write, pull_requests:write'
- name: Setup Git user
run: |
git config --global user.email '118100583+bfra-me[bot]@users.noreply.github.com'
git config --global user.name 'bfra.me'
- name: Checkout `release` branch
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
ref: release
token: ${{ steps.get-workflow-access-token.outputs.token }}
- if: ${{ github.event_name == 'pull_request' }}
name: Fetch PR
run: git fetch origin +${{ github.sha }}:${{ github.ref }}
- id: merge
name: Merge `main` into `release`
run: |
git merge --no-ff -Xtheirs -m 'skip: merge (${{ github.sha }}) [skip release]' ${{ github.sha }}
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Setup Node.js
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version: 'lts/*'
- name: Enable corepack
run: corepack enable
- name: Install dependencies
run: yarn install --immutable
- if: env.DRY_RUN != 'true'
name: Push `release` branch
run: git push origin release:release
- env:
GIT_AUTHOR_EMAIL: '118100583+bfra-me[bot]@users.noreply.github.com'
GIT_AUTHOR_NAME: 'bfra.me'
GIT_COMMITTER_EMAIL: '118100583+bfra-me[bot]@users.noreply.github.com'
GIT_COMMITTER_NAME: 'bfra.me'
GITHUB_TOKEN: ${{ steps.get-workflow-access-token.outputs.token }}
name: Semantic Release
run: |
export GITHUB_REF=refs/heads/release GITHUB_SHA=${{ steps.merge.outputs.commit }}
yarn semantic-release --dry-run ${{ env.DRY_RUN }} --ci ${{ env.DRY_RUN != 'true' }}