Skip to content

chore(deps): bump postcss, next and @storybook/nextjs #13312

chore(deps): bump postcss, next and @storybook/nextjs

chore(deps): bump postcss, next and @storybook/nextjs #13312

# It does magic only if there is package.json file in the root of the project.
# Runs untrusted PR code under pull_request (no secrets). Privileged follow-up
# (comments + Codecov for PRs) lives in if-nodejs-pr-results.yml.
name: PR testing - if Node project
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
push:
branches: [master]
jobs:
test-nodejs-pr:
name: Test NodeJS PR - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- if: >
!github.event.pull_request.draft && !(
(github.actor == 'asyncapi-bot' && (
startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') ||
startsWith(github.event.pull_request.title, 'chore(release):')
)) ||
(github.actor == 'asyncapi-bot-eve' && (
startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') ||
startsWith(github.event.pull_request.title, 'chore(release):')
)) ||
(github.actor == 'allcontributors[bot]' &&
startsWith(github.event.pull_request.title, 'docs: add')
)
)
id: should_run
name: Should Run
run: echo "shouldrun=true" >> $GITHUB_OUTPUT
shell: bash
- if: steps.should_run.outputs.shouldrun == 'true'
name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows
run: |
git config --global core.autocrlf false
git config --global core.eol lf
shell: bash
- if: steps.should_run.outputs.shouldrun == 'true'
name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- if: steps.should_run.outputs.shouldrun == 'true'
name: Check if Node.js project and has package.json
id: packagejson
run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT
shell: bash
- if: steps.packagejson.outputs.exists == 'true'
name: Check if .nvmrc exists
id: nvmrc
run: test -e .nvmrc && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT
shell: bash
- if: steps.nvmrc.outputs.exists == 'true'
name: Read Node.js version from .nvmrc
id: nodeversion
run: echo "version=$(cat .nvmrc)" >> $GITHUB_OUTPUT
shell: bash
- if: steps.packagejson.outputs.exists == 'true' && steps.nvmrc.outputs.exists == 'true'
name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '${{ steps.nodeversion.outputs.version }}'
- if: steps.packagejson.outputs.exists == 'true'
name: Install dependencies
run: npm ci
- if: steps.packagejson.outputs.exists == 'true'
name: Test
run: npm test --if-present
- if: steps.packagejson.outputs.exists == 'true' && matrix.os == 'ubuntu-latest'
name: Run linter
run: npm run lint --if-present
- if: steps.packagejson.outputs.exists == 'true'
name: Run release assets generation to make sure PR does not break it
shell: bash
run: npm run generate:assets --if-present
# Run the test:md script; on PRs write results for the privileged comment workflow
- if: ${{ steps.packagejson.outputs.exists == 'true' && matrix.os == 'ubuntu-latest' }}
name: Run markdown checks
id: markdown_check
run: |
set +e
ERRORS=$(npm run test:md | sed -n '/Errors in file/,$p')
set -e
if [ "${{ github.event_name }}" = "pull_request" ]; then
mkdir -p pr-check-results
printf '%s' "$ERRORS" > pr-check-results/markdown_output.txt
fi
# Run the test:locales script; on PRs write results for the privileged comment workflow
- if: ${{ steps.packagejson.outputs.exists == 'true' && matrix.os == 'ubuntu-latest' }}
name: Run locale checks
id: locale_check
run: |
set +e
LOCALE_OUTPUT=$(npm run test:locales 2>&1)
EXIT_CODE=$?
set -e
if [ "${{ github.event_name }}" = "pull_request" ]; then
mkdir -p pr-check-results
if [ $EXIT_CODE -ne 0 ]; then
LANGUAGES=$(echo "$LOCALE_OUTPUT" | grep "Found" | sed 's/.*Found \(.*\) languages.*/Found \1 languages:/')
MISSING_KEYS=$(echo "$LOCALE_OUTPUT" | grep -A 100 "Missing keys in" | grep -v "\[.*PM\] \|^\s*$")
CLEANED_OUTPUT="$LANGUAGES\n\n$MISSING_KEYS"
echo -e "$CLEANED_OUTPUT" > pr-check-results/locale_output.txt
else
: > pr-check-results/locale_output.txt
fi
fi
- if: ${{ steps.packagejson.outputs.exists == 'true' && matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request' }}
name: Upload PR check results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pr-check-results
path: pr-check-results/
if-no-files-found: ignore
- if: ${{ steps.packagejson.outputs.exists == 'true' && matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request' }}
name: Upload coverage artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: coverage-lcov
path: coverage/lcov.info
if-no-files-found: ignore
# Trusted push to master: upload coverage with secrets in this workflow
- if: steps.packagejson.outputs.exists == 'true' && github.event_name == 'push'
name: Upload Coverage to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
fail_ci_if_error: true
files: ./coverage/lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true