build(deps-dev): update dependency @types/node-fetch to ^2.6.7 #3105
Workflow file for this run
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: test | |
on: | |
push: | |
branches: | |
- '*' | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
provide_wa_versions: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 | |
- name: Setup Node | |
uses: actions/setup-node@v3.8.1 | |
with: | |
node-version: 16.x | |
- name: Get npm cache directory | |
id: npm-cache | |
run: | | |
echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT | |
- name: Setup npm cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.npm-cache.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install Dependencies | |
run: npm ci || npm install | |
- uses: actions/github-script@v6 | |
id: versions | |
with: | |
script: | | |
const packageJSON = require('./package.json'); | |
const waVersion = require('@wppconnect/wa-version'); | |
const semver = require('semver'); | |
const supportedVersion = packageJSON.engines['whatsapp-web']; | |
const allVersions = waVersion.getAvailableVersions(); | |
let versions = allVersions.filter( | |
(v) => semver.satisfies(v, supportedVersion, {includePrerelease: true}) | |
); | |
versions = versions.map(v => v.split('.').slice(0, -1).join('.') + '.x'); | |
versions = versions.filter((v,i,a)=>a.indexOf(v)==i); | |
return versions.reverse() | |
outputs: | |
versions: ${{ steps.versions.outputs.result }} | |
test: | |
needs: provide_wa_versions | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
versions: ${{ fromJson(needs.provide_wa_versions.outputs.versions) }} | |
include: | |
- versions: '' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 | |
- name: Setup Node | |
uses: actions/setup-node@v3.8.1 | |
with: | |
node-version: 16.x | |
- name: Get npm cache directory | |
id: npm-cache | |
run: | | |
echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT | |
- name: Setup npm cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.npm-cache.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install Dependencies | |
run: npm ci || npm install | |
- name: Test modules resolution | |
uses: nick-invision/retry@v2 | |
with: | |
timeout_minutes: 10 | |
max_attempts: 3 | |
command: npm run update-module-id -- --dry-run | |
env: | |
WA_VERSION: '${{matrix.versions }}' |