From 2dda278adcbc68b103baa06f205170a27cb9c43d Mon Sep 17 00:00:00 2001 From: Sysix Date: Wed, 9 Oct 2024 18:52:28 +0200 Subject: [PATCH 1/7] chore(ci): split lint and test into own jobs --- .github/workflows/lint.yml | 20 ++++++++++++++++++++ .github/workflows/test.yml | 3 --- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..bd288d2 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,20 @@ +name: Lint + +on: + pull_request: + types: [opened, synchronize] + push: + branches: + - main + - 'renovate/**' + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: ./.github/actions/pnpm + + - name: Run Linters + run: pnpm run lint diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 20ce761..f5a628b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,8 +16,5 @@ jobs: - uses: ./.github/actions/pnpm - - name: Run Linters - run: pnpm run lint - - name: Run tests run: pnpm run test --coverage From 39e1ff671541fc8f666e5dc79df63ae06c6fa3a3 Mon Sep 17 00:00:00 2001 From: Sysix Date: Wed, 9 Oct 2024 18:53:27 +0200 Subject: [PATCH 2/7] chore(ci): add pnpm run format --- .github/workflows/format.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/format.yml diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..dc3aac2 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,20 @@ +name: Format (prettier) + +on: + pull_request: + types: [opened, synchronize] + push: + branches: + - main + - 'renovate/**' + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: ./.github/actions/pnpm + + - name: Run Format (prettier) + run: pnpm run format From e38da8cc63facf652f57fea419422e3c7b78744f Mon Sep 17 00:00:00 2001 From: Sysix Date: Wed, 9 Oct 2024 18:55:35 +0200 Subject: [PATCH 3/7] chore(ci): format and build when bumping oxlint --- .github/workflows/bump_oxlint.yml | 2 ++ .prettierignore | 3 +-- eslint.config.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bump_oxlint.yml b/.github/workflows/bump_oxlint.yml index 3c77027..ed1679d 100644 --- a/.github/workflows/bump_oxlint.yml +++ b/.github/workflows/bump_oxlint.yml @@ -23,7 +23,9 @@ jobs: pnpm update --latest oxlint pnpm run clone pnpm run generate # Generate rules from latest oxlint + pnpm run format # run prettier over it pnpm run test -u # Update test snapshots + pnpm run build # build cjs, mjs and d.ts files npm version ${{ inputs.version }} --no-git-tag-version - uses: peter-evans/create-pull-request@v7 diff --git a/.prettierignore b/.prettierignore index f216e7a..0a8eaa6 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,3 @@ pnpm-lock.yaml -rules.js -rules.cjs +lib/ ~ diff --git a/eslint.config.js b/eslint.config.js index 72c433a..0e47630 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -14,6 +14,6 @@ export default [ eslintConfigPrettier, oxlint.configs['flat/all'], { - ignores: ["lib/"] + ignores: ['lib/'], }, ]; From 53644a15b95016fcf4634fa9362d3c5cb6b21109 Mon Sep 17 00:00:00 2001 From: Sysix Date: Wed, 9 Oct 2024 19:09:16 +0200 Subject: [PATCH 4/7] chore(ci): prettier with --check and lint into own commands --- .github/workflows/format.yml | 2 +- .github/workflows/lint.yml | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index dc3aac2..28da462 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -17,4 +17,4 @@ jobs: - uses: ./.github/actions/pnpm - name: Run Format (prettier) - run: pnpm run format + run: npx prettier . --check diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bd288d2..79f9510 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,5 +16,8 @@ jobs: - uses: ./.github/actions/pnpm - - name: Run Linters - run: pnpm run lint + - name: Run oxlint + run: npx oxlint + + - name: Run eslint + run: npx eslint \ No newline at end of file From 4579c0bac2dfd08a0633bcbc82afc8dbed168996 Mon Sep 17 00:00:00 2001 From: Sysix Date: Wed, 9 Oct 2024 19:18:51 +0200 Subject: [PATCH 5/7] chore(ci): fix pipeline --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 79f9510..52b0925 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,4 +20,4 @@ jobs: run: npx oxlint - name: Run eslint - run: npx eslint \ No newline at end of file + run: npx eslint From c34aed5362e88e4939720e633494f7daa2d4a1d2 Mon Sep 17 00:00:00 2001 From: Sysix Date: Wed, 9 Oct 2024 19:21:05 +0200 Subject: [PATCH 6/7] chore(ci): rename jobs --- .github/workflows/format.yml | 2 +- .github/workflows/lint.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 28da462..5e0b5d3 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -9,7 +9,7 @@ on: - 'renovate/**' jobs: - test: + format: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 52b0925..a57d9ba 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,7 +9,7 @@ on: - 'renovate/**' jobs: - test: + lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 5aee7a4f18ce2ce772ef805fff85fb3e288e898f Mon Sep 17 00:00:00 2001 From: Sysix Date: Thu, 10 Oct 2024 00:13:39 +0200 Subject: [PATCH 7/7] chore(ci): remove pnpm setup where there is no need --- .github/workflows/format.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 5e0b5d3..d0a598b 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -14,7 +14,5 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/pnpm - - name: Run Format (prettier) run: npx prettier . --check