Skip to content

[WIP] CI: use annotated error message #122

[WIP] CI: use annotated error message

[WIP] CI: use annotated error message #122

Workflow file for this run

name: CI
on:
- push
env:
NODE_VERSION_FOR_PUBLISH: "20"
jobs:
# test:
# name: Test
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node:
# - "18"
# - "20"
# env:
# # Reduce ANSI terminal output for webpack and Cypress
# NO_COLOR: 1
# steps:
# - name: Checkout git repository
# uses: actions/checkout@v4
# with:
# fetch-depth: 1
# - name: Setup node.js
# uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node }}
# - name: Cache ~/.npm for Node ${{ matrix.node }}
# uses: actions/cache@v3
# with:
# path: ~/.npm
# key: ${{ runner.os }}-node-${{ matrix.node }}-npm-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-node-${{ matrix.node }}-npm-
# - name: Cache ~/.cache/Cypress for Node ${{ matrix.node }}
# uses: actions/cache@v3
# with:
# path: ~/.cache/Cypress
# key: ${{ runner.os }}-node-${{ matrix.node }}-cypress-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-node-${{ matrix.node }}-cypress-
# - name: Install npm dependencies
# run: npm ci
# - name: Verify Cypress installation
# run: ./node_modules/.bin/cypress verify
# - name: Run tests
# run: npm test
publish:

Check failure on line 51 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / CI

Invalid workflow file

The workflow is not valid. .github/workflows/ci.yml (Line: 51, Col: 3): The workflow must contain at least one job with no dependencies.
name: Publish
runs-on: ubuntu-latest
needs:
- test
# if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
if: github.ref_type != 'tag'
steps:
- name: Checkout git repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION_FOR_PUBLISH }}
registry-url: https://registry.npmjs.org
- name: Cache ~/.npm for Node ${{ env.NODE_VERSION_FOR_PUBLISH }}
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ env.NODE_VERSION_FOR_PUBLISH }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ env.NODE_VERSION_FOR_PUBLISH }}-npm-
- name: Install npm dependencies
run: npm ci
- name: Check that git tag and npm package version match
run: |
npm_package_version=$(node --eval 'console.log(require("./package.json").version)')
git_tag_version="${GITHUB_REF_NAME:1}"
if [[ "$npm_package_version" != "$git_tag_version" ]]; then
echo "::error::npm package version and git tag differ: npm_package_version=$npm_package_version git_tag_version=$git_tag_version" >&2
false
fi
- name: Publish npm package
run: echo npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}