Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI workflow to latest node versions #262

Open
3 tasks
rajasegar opened this issue Jan 6, 2023 · 0 comments
Open
3 tasks

Update CI workflow to latest node versions #262

rajasegar opened this issue Jan 6, 2023 · 0 comments

Comments

@rajasegar
Copy link
Contributor

Since the generated project uses old node versions like 10 and 12, the CI fails too often.
This is my updated CI file which has consistent success rate.

name: CI

on:
  push:
    branches:
      - master
      - main
      - 'v*' # older version branches
    tags:
      - '*'
  pull_request: {}
  schedule:
  - cron:  '0 6 * * 0' # weekly, on sundays

jobs:
  lint:
    name: Linting
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-node@v3
      with:
        node-version: 16
    - name: install dependencies
      run: yarn install --frozen-lockfile
    - name: linting
      run: yarn lint

  test:
    name: Tests
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node: ['14', '16', '18']

    steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-node@v3
      with:
        node-version: ${{ matrix.node }}
    - name: install dependencies
      run: yarn install --frozen-lockfile
    - name: test
      run: yarn test

  floating-test:
    name: Floating dependencies
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-node@v3
      with:
        node-version: 16
    - name: install dependencies
      run: yarn install --no-lockfile
    - name: test
      run: yarn test

Changes required:

  • Use latest actions for check-out and setup-node (v3)
  • Drop node versions 10 and 12 and use 14, 16 and 18
  • Running the jobs with node version 16 as suggested by Github

Sample workflow file:
https://github.com/rajasegar/react-router-v6-codemods/blob/main/.github/workflows/ci.yml

Sample runs (before and after making the changes):
https://github.com/rajasegar/react-router-v6-codemods/actions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant