From 69541e19bf0b8bc48ce91e375bff0d63e80266d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Magalh=C3=A3es?= Date: Sat, 9 Nov 2024 19:33:32 +0000 Subject: [PATCH] chore: improved actions --- .github/workflows/deploy.yml | 23 ++++++++++++++++------- .github/workflows/main.yml | 29 ++++++++++++++++++++--------- 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 17819c8..109e644 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,13 +13,22 @@ jobs: runs-on: ubuntu-latest container: node:${{ matrix.node-version }}-buster steps: - - uses: actions/checkout@v4 - - run: node --version - - run: npm install - - run: npm install --only=dev - - run: npm run lint - - run: npm test - - run: | + - name: Checkout code from repository + uses: actions/checkout@v4 + - name: Print Node.js information + run: node --version + - name: Install package + run: npm install + - name: Install package (development) + run: npm install --only=dev + - name: Build package + run: npm run build + - name: Verify Javascript code linting + run: npm run lint + - name: Run unit tests + run: npm test + - name: Deploy package to NPM + run: | echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc npm publish env: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5b23d88..bdd4cb4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,18 +1,29 @@ name: Main Workflow -on: [push] +on: + push: + schedule: + - cron: "0 0 * * 0" jobs: build: name: Build timeout-minutes: 10 strategy: matrix: - node-version: [14, 15, 16, 17, 18, 19, 20, 21, 22] + node-version: [14, 16, 17, 18, 19, 20] runs-on: ubuntu-latest - container: node:${{ matrix.node-version }} + container: node:${{ matrix.node-version }}-buster steps: - - uses: actions/checkout@v4 - - run: node --version - - run: npm install - - run: npm install --only=dev - - run: npm run lint - - run: npm test + - name: Checkout code from repository + uses: actions/checkout@v4 + - name: Print Node.js information + run: node --version + - name: Install package + run: npm install + - name: Install package (development) + run: npm install --only=dev + - name: Build package + run: npm run build + - name: Verify Javascript code linting + run: npm run lint + - name: Run unit tests + run: npm test