chore(deps-dev): bump eslint from 8.48.0 to 8.51.0 (#1539) #59
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: check | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- v* | |
pull_request: | |
branches: | |
- master | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
version: | |
name: Ensure package version match | |
if: startsWith(github.ref_name, 'v') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Check Git tag format | |
run: | | |
_tag="${{ github.ref_name }}" | |
if ! printf "%s\n" "$_tag" | grep -q -P '^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-(alpha|beta|rc)\.(0|[1-9][0-9]*))?$'; then | |
printf '[ERROR]: Git tag (%s) wrong format\n' "$_tag" | |
exit 1 | |
fi | |
- name: Read package.json version | |
uses: sergeysova/jq-action@v2 | |
id: version_package | |
with: | |
cmd: jq --raw-output .version package.json | |
- name: Read GitHub version | |
uses: pozetroninc/github-action-get-latest-release@master | |
id: version_v_github | |
with: | |
owner: MichalLytek | |
repo: type-graphql | |
excludes: prerelease, draft | |
- name: Remove leading v* from GitHub version | |
id: version_github | |
run: | | |
_version="${{ steps.version_v_github.outputs.release }}" | |
printf 'value=%s\n' "${_version#?}" >> "$GITHUB_OUTPUT" | |
- name: Read Git tag version | |
id: version_gittag | |
run: | | |
_version="${{ github.ref_name }}" | |
printf 'value=%s\n' "${_version#?}" >> "$GITHUB_OUTPUT" | |
- name: Compare package.json with Git tag | |
uses: madhead/semver-utils@latest | |
id: comparison_package_gittag | |
with: | |
version: ${{ steps.version_package.outputs.value }} | |
compare-to: ${{ steps.version_gittag.outputs.value }} | |
lenient: false | |
- name: Compare Git tag with GitHub | |
uses: madhead/semver-utils@latest | |
id: comparison_gittag_github | |
with: | |
version: ${{ steps.version_gittag.outputs.value }} | |
compare-to: ${{ steps.version_github.outputs.value }} | |
lenient: false | |
- name: Check package.json == Git tag | |
run: | | |
if [ ! "${{ steps.comparison_package_gittag.outputs.comparison-result }}" = "=" ]; then | |
printf '[ERROR]: package.json (%s) != Git tag (%s)\n' "${{ steps.version_package.outputs.value }}" "${{ steps.version_gittag.outputs.value }}" | |
exit 1 | |
fi | |
- name: Check Git tag > GitHub | |
run: | | |
if [ ! "${{ steps.comparison_gittag_github.outputs.comparison-result }}" = ">" ]; then | |
printf '[ERROR]: Git tag (%s) !> GitHub (%s)\n' "${{ steps.version_gittag.outputs.value }}" "${{ steps.version_github.outputs.value }}" | |
exit 1 | |
fi | |
check: | |
name: Build & Lint & Test | |
needs: version | |
if: always() && (needs.version.result == 'success' || needs.version.result == 'skipped') | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
node-version: [16.x, 18.x, 20.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install Dependencies | |
run: | | |
npm ci | |
- name: Build | |
run: | | |
npm run build | |
npm run build:benchmarks | |
- name: Check | |
run: | | |
npm run check | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Test | |
run: npm run test:ci | |
env: | |
CI: true | |
- name: Upload code coverage | |
uses: codecov/codecov-action@v3 | |
if: matrix.node-version == '18.x' |