cargo-semver-checks/.github/workflows/test-build.yml
dependabot[bot] 5bf52b80b3
Bump actions/setup-node from 3 to 4 (#74)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-19 17:35:22 +00:00

54 lines
1.9 KiB
YAML

name: Test action build
on:
workflow_call:
jobs:
test-build:
name: Build the action and run TypeScript tests
runs-on: ubuntu-latest
steps:
- name: Checkout the action
uses: actions/checkout@v3
- name: Setup Node.js 16.x
uses: actions/setup-node@v4
with:
node-version: 16
- name: Install npm-cli-login
run: npm install -g npm-cli-login
- name: Login to GitHub npm registry
# Both username and email address are irrelevant here, but they must be
# specified because otherwise npm-cli-login fails.
run: |
npm-cli-login -s @actions-rs -r https://npm.pkg.github.com \
-u does_not_matter -p ${{ secrets.GITHUB_TOKEN }} -e does_not_m@ter.com
- name: Install dependencies
run: npm ci
- name: Rebuild the action and run tests
run: npm run all
- name: Compare the expected and actual src/ directories
run: |
if [ "$(git diff src/ | wc -l)" -gt "0" ]; then
echo "Source files are not properly formatted!"
exit 1
fi
id: diff_src
- name: Upload the expected version of src/ in case of failure
uses: actions/upload-artifact@v4
if: ${{ failure() && steps.diff_src.conclusion == 'failure' }}
with:
name: expected-src
path: src/
- name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff dist/ | wc -l)" -gt "0" ]; then
echo "Built sources do not match the content of the dist/ directory!"
exit 1
fi
id: diff_dist
- name: Upload the expected version of dist/ in case of failure
uses: actions/upload-artifact@v4
if: ${{ failure() && steps.diff_dist.conclusion == 'failure' }}
with:
name: expected-dist
path: dist/