Update npm dependencies #1183
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| workflow_dispatch: | |
| pull_request: | |
| jobs: | |
| check_database: | |
| name: Check database | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Fetch all branches | |
| run: | | |
| CURRENT_BRANCH="$(git branch --show-current)" | |
| if [ "$CURRENT_BRANCH" = '' ]; then | |
| CURRENT_BRANCH="$GITHUB_HEAD_REF" | |
| echo "GITHUB_REF: $GITHUB_REF" | |
| fi | |
| echo -------- current branch | |
| echo "$CURRENT_BRANCH" | |
| echo -------- | |
| for branch in $(git branch --all | grep '^\s*remotes' | grep -vE "HEAD|$CURRENT_BRANCH"); do | |
| echo "branch: $branch" | |
| if [[ "$branch" != remotes/pull* ]]; then | |
| git branch --track "${branch##*/}" "$branch" | |
| fi | |
| done | |
| echo -------- | |
| git fetch --all | |
| # echo -------- | |
| # git checkout "$CURRENT_BRANCH" | |
| echo -------- | |
| git branch -v | |
| echo -------- | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| cache-dependency-path: 'package-lock.json' | |
| - run: npm ci | |
| - name: Get Date | |
| id: get-date | |
| run: | | |
| echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT | |
| - name: Restore cached mod archives | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| build/cache | |
| key: mod-cache-${{ steps.get-date.outputs.date }} | |
| restore-keys: | | |
| mod-cache- | |
| - name: Test the stable branch | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: BRANCH=stable npm run test | |
| - name: Test the testing branch | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: BRANCH=testing npm run test | |
| - name: Save mod archive cache | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| build/cache | |
| key: mod-cache-${{ steps.get-date.outputs.date }} |