🔧 chore[workflow]: update GitHub workflow fix invalid path #11
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: Node.js CI | |
on: | |
push: | |
branches: ["master", "develop"] | |
pull_request: | |
branches: ["master", "develop"] | |
jobs: | |
build: | |
runs-on: self-hosted | |
strategy: | |
matrix: | |
node-version: [22.x] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
- name: Print current directory and list files | |
run: | | |
echo "Current directory:" | |
pwd | |
echo "Listing files in the repository:" | |
ls -la | |
- name: Install dependencies | |
run: | | |
if [ -f milkyway-bot/report-server/package-lock.json ]; then | |
npm ci | |
else | |
npm install | |
fi | |
working-directory: milkyway-bot/report-server | |
- name: Build the project | |
run: npm run build --if-present | |
working-directory: milkyway-bot/report-server | |
- name: Run tests | |
run: npm test | |
working-directory: milkyway-bot/report-server |