Skip to content

Commit

Permalink
change node version to 20.x (#6514)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael18811380328 authored Aug 9, 2024
1 parent 9478d46 commit 1eda949
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
python-version: "3.8"
- uses: actions/setup-node@v3
with:
node-version: "16.x"
node-version: "20.x"

- name: gettext for django
run: |
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ env:
jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
Expand Down Expand Up @@ -51,10 +46,9 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
node-version: "20.x"

- name: run npm lint
run: |
cd $GITHUB_WORKSPACE/tests/
chmod +x github_actions_npm_lint.sh
./github_actions_npm_lint.sh
if chmod +x test_frontend_changes.sh && ./test_frontend_changes.sh; then chmod +x github_actions_npm_lint.sh && ./github_actions_npm_lint.sh; else true; fi
6 changes: 0 additions & 6 deletions tests/github_actions_npm_lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,10 @@ fi

export GITHUB_BRANCH=$branch

echo "GITHUB_BRANCH: $GITHUB_BRANCH"

export PYTHONPATH="${PYTHONPATH}:/tmp/site-packages"

echo "PYTHONPATH: $PYTHONPATH"

echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >~/.npmrc

cd $GITHUB_WORKSPACE

echo "npm run lint on frontend/src files..."

cd ./frontend && npm install && npm run lint
26 changes: 26 additions & 0 deletions tests/test_frontend_changes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

check_path_fn()
{
FN=$1
shift
patt="frontend*"
[[ $FN == $patt ]] && return 1
return 0
}

FILES=`git diff --name-only HEAD~`

for i in $FILES
do
check_path_fn $i
retval=$?

if [ "$retval" == 1 ]; then
echo "File changes need to trigger tests."
exit 0
fi

done

exit 1

0 comments on commit 1eda949

Please sign in to comment.