Skip to content

Commit

Permalink
add file checks on lints & tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Baja-KS committed Aug 2, 2024
1 parent 75d4904 commit da85f80
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 13 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,24 @@ jobs:
id: code_lint
run: |
cd ${{ matrix.workdir }}
npm i
if [ ! -f lint.sh ]; then
echo "lint skipped" | tee code_lint_output.txt
exit 0
fi
set -o pipefail
# npm run lint 2>&1 | tee code_lint_output.txt
echo "no lint for now, skip" | tee code_lint_output.txt
sudo chmod +x lint.sh && ./lint.sh 2>&1 | tee code_lint_output.txt
- name: Unit tests
id: unit_tests
run: |
cd ${{ matrix.workdir }}
npm i
if [ ! -f unit-test.sh ]; then
echo "unit tests skipped" | tee code_lint_output.txt
exit 0
fi
set -o pipefail
# npm run test 2>&1 | tee unit_test_output.txt
echo "no tests for now, skip" | tee unit_test_output.txt
sudo chmod +x unit-test.sh && ./unit-test.sh 2>&1 | tee unit_test_output.txt
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand Down Expand Up @@ -149,5 +154,5 @@ jobs:
--project ${{ env.PROJECT }} \
--environment ${{ env.ENVIRONMENT }} \
--container ${{ steps.image_lowercase.outputs.lowercase }} \
--tag :${{ env.TAG }} \
--tag ${{ env.TAG }} \
--watch
17 changes: 11 additions & 6 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,24 @@ jobs:
id: code_lint
run: |
cd ${{ matrix.workdir }}
npm i
if [ ! -f lint.sh ]; then
echo "lint skipped" | tee code_lint_output.txt
exit 0
fi
set -o pipefail
# npm run lint 2>&1 | tee code_lint_output.txt
echo "no lint for now, skip" | tee code_lint_output.txt
sudo chmod +x lint.sh && ./lint.sh 2>&1 | tee code_lint_output.txt
- name: Unit tests
id: unit_tests
run: |
cd ${{ matrix.workdir }}
npm i
if [ ! -f unit-test.sh ]; then
echo "unit tests skipped" | tee code_lint_output.txt
exit 0
fi
set -o pipefail
# npm run test 2>&1 | tee unit_test_output.txt
echo "no tests for now, skip" | tee unit_test_output.txt
sudo chmod +x unit-test.sh && ./unit-test.sh 2>&1 | tee unit_test_output.txt
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand Down
3 changes: 3 additions & 0 deletions backend/lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

echo "no lint"
3 changes: 3 additions & 0 deletions backend/unit-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

echo "unit tests"

0 comments on commit da85f80

Please sign in to comment.