test for dev version sync false fails when dev version produces no gi… #72
Workflow file for this run
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: Options Tests | |
on: | |
pull_request: | |
jobs: | |
options-test: | |
runs-on: ${{ matrix.os }} | |
env: | |
term: xterm | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- windows-2022 | |
- ubuntu-22.04 | |
- macos-12 | |
node-version: | |
- '20' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install node ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: npm | |
- name: Install deps and prep | |
run: | | |
npm clean-install | |
npm run prepare | |
- name: Prepare release | |
uses: ./ | |
with: | |
version: v5.0.0 | |
commands: | | |
touch riker | |
touch picard | |
lando-plugin: false | |
meta: | | |
jazzman=William T. Riker | |
bosmang=Picard | |
root: ${{ github.workspace }} | |
sync: false | |
sync-email: william.t.riker@starfleet.mil | |
sync-message: riker | |
sync-tags: number1 | |
sync-username: Will | |
- name: "TEST: should set the version in the package.json" | |
if: always() | |
run: | | |
if cat "${{ github.workspace }}/package.json" | grep version | grep 5.0.0; then | |
echo "::notice title=TEST PASSED::Version set in package.json correctly" | |
else | |
echo "::error title=TEST FAILED!::Version not set in package.json correctly" | |
exit 1 | |
fi | |
shell: bash | |
- name: "TEST: should set the meta in the package.json" | |
if: always() | |
run: | | |
if cat "${{ github.workspace }}/package.json" | grep jazzman | grep "William T. Riker"; then | |
echo "::notice title=TEST PASSED::Meta set in package.json correctly" | |
else | |
echo "::error title=TEST FAILED!::Meta not set in package.json correctly" | |
exit 1 | |
fi | |
shell: bash | |
- name: "TEST: should set the meta in the package.json" | |
if: always() | |
run: | | |
if cat "${{ github.workspace }}/package.json" | grep bosmang | grep Picard; then | |
echo "::notice title=TEST PASSED::Meta set in package.json correctly" | |
else | |
echo "::error title=TEST FAILED!::Meta not set in package.json correctly" | |
exit 1 | |
fi | |
shell: bash | |
- name: "TEST: should set the correct tags" | |
if: always() | |
run: | | |
if git --no-pager tag --points-at HEAD | grep v5.0.0 && git --no-pager tag --points-at HEAD | grep number1; then | |
echo "::notice title=TEST PASSED::Tags set correctly" | |
else | |
echo "::error title=TEST FAILED!::Tags not set correctly" | |
exit 2 | |
fi | |
shell: bash | |
- name: "TEST: should run the commands successfully" | |
if: always() | |
run: | | |
if stat riker && stat picard; then | |
echo "::notice title=TEST PASSED::Commands ran successfully" | |
else | |
echo "::error title=TEST FAILED!::Commands did not run successfully" | |
exit 3 | |
fi | |
shell: bash | |
- name: "TEST: should set git email and username correctly" | |
if: always() | |
run: | | |
if git --no-pager config -l | grep user.name | grep Will && git --no-pager config -l | grep user.email | grep william.t.riker@starfleet.mil; then | |
echo "::notice title=TEST PASSED::Git user and email config set correctly" | |
else | |
echo "::error title=TEST FAILED!::Git user and email config not set correctly" | |
exit 4 | |
fi | |
shell: bash | |