From cd6f4a3fe0bb8a9445f71358f67c067b3979eaf9 Mon Sep 17 00:00:00 2001 From: Amaresh S M <30730124+amareshsm@users.noreply.github.com> Date: Sat, 19 Oct 2024 00:45:58 +0530 Subject: [PATCH 1/3] ci: add CI to the project --- .github/workflows/ci.yml | 72 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7a62448 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,72 @@ +name: CI +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Install Packages + run: npm install + env: + CI: true + - name: Lint + run: npm run lint + + format: + name: File Format + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Install Packages + run: npm install + env: + CI: true + - name: Prettier Check + run: npm run fmt + + test: + name: Test + strategy: + matrix: + os: [ubuntu-latest] + eslint: [9] + node: [22.x, 21.x, 20.x] + include: + - os: windows-latest + eslint: 9 + node: 20 + - os: macOS-latest + eslint: 9 + node: 20 + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Node.js ${{ matrix.node }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - name: Install Packages + run: npm install + env: + CI: true + - name: Install ESLint@${{ matrix.eslint }} + run: npm install eslint@${{ matrix.eslint }} + - name: Test + run: npm run test From 36d12b0fbdf5e028b41716a2aa751c41b85e4282 Mon Sep 17 00:00:00 2001 From: Amaresh S M <30730124+amareshsm@users.noreply.github.com> Date: Sun, 20 Oct 2024 00:10:42 +0530 Subject: [PATCH 2/3] Update ci.yml --- .github/workflows/ci.yml | 37 ++----------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a62448..2b69366 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,10 +16,9 @@ jobs: uses: actions/setup-node@v4 with: node-version: lts/* + cache: "npm" - name: Install Packages run: npm install - env: - CI: true - name: Lint run: npm run lint @@ -33,40 +32,8 @@ jobs: uses: actions/setup-node@v4 with: node-version: lts/* + cache: "npm" - name: Install Packages run: npm install - env: - CI: true - name: Prettier Check run: npm run fmt - - test: - name: Test - strategy: - matrix: - os: [ubuntu-latest] - eslint: [9] - node: [22.x, 21.x, 20.x] - include: - - os: windows-latest - eslint: 9 - node: 20 - - os: macOS-latest - eslint: 9 - node: 20 - runs-on: ${{ matrix.os }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install Node.js ${{ matrix.node }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - - name: Install Packages - run: npm install - env: - CI: true - - name: Install ESLint@${{ matrix.eslint }} - run: npm install eslint@${{ matrix.eslint }} - - name: Test - run: npm run test From 7da0307fff8a46cff2666e09e9196dceec19283b Mon Sep 17 00:00:00 2001 From: Amaresh S M <30730124+amareshsm@users.noreply.github.com> Date: Sun, 20 Oct 2024 00:12:45 +0530 Subject: [PATCH 3/3] Update ci.yml --- .github/workflows/ci.yml | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b69366..afe96f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,34 +6,24 @@ on: branches: [main] jobs: - lint: - name: Lint + lint_and_format: + name: Lint and Format runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 + - name: Install Node.js uses: actions/setup-node@v4 with: node-version: lts/* cache: "npm" + - name: Install Packages run: npm install + - name: Lint run: npm run lint - format: - name: File Format - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: lts/* - cache: "npm" - - name: Install Packages - run: npm install - name: Prettier Check run: npm run fmt