[CI/CD] Check For Clean Tree #2
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: Test Clean Tree | |
on: | |
pull_request: | |
jobs: | |
git-clean-tree-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install yarn | |
run: npm install -g yarn | |
- name: make sure package.lock does not exist | |
run: rm -f package-lock.json | |
- name: Check Tree if package-lock.json file was existing and removed | |
run: | | |
if [[ -n $(git status -s) ]]; then | |
echo "ERROR: tree is dirty after removing package-lock.json file" | |
git status | |
exit 1 | |
else | |
echo "Working tree is clean." | |
fi | |
- name: Install dependencies | |
run: yarn | |
- name: Check Tree after yarn | |
run: | | |
if [[ -n $(git status -s) ]]; then | |
echo "ERROR: tree is dirty after yarn" | |
git status | |
exit 1 | |
else | |
echo "Working tree is clean." | |
fi | |
- name: Build | |
run: yarn build | |
- name: Check Tree after build | |
run: | | |
if [[ -n $(git status -s) ]]; then | |
echo "ERROR: tree is dirty after yarn build" | |
git status | |
exit 1 | |
else | |
echo "Working tree is clean." | |
fi | |
- name: Clean up | |
if: always() | |
run: npm uninstall -g yarn |