feat: update minimal supported version of Node.js to v20 #257
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
| # This workflow runs for every pull request to lint and test the proposed changes. | |
| name: Check | |
| on: | |
| pull_request: | |
| workflow_call: | |
| jobs: | |
| lint_and_test: | |
| name: Lint & Test | |
| if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| node-version: [16, 18, 20] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Install Dependencies | |
| run: npm install | |
| # Lint only on the latest Node.js version to save time. | |
| - name: Lint code | |
| if: ${{ matrix.node-version == 20 }} | |
| run: npm run lint | |
| - name: Add localhost-test to Linux hosts file | |
| run: sudo echo "127.0.0.1 localhost-test" | sudo tee -a /etc/hosts | |
| - name: Run Tests | |
| run: npm test |