Skip to content

Commit 6244a98

Browse files
committed
ci: migrate to GitHub Actions
1 parent 04dc6ef commit 6244a98

File tree

5 files changed

+40
-23
lines changed

5 files changed

+40
-23
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18, 23]
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
cache: "npm"
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Run verification
31+
run: npm run verify

.travis.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
> Measure the churn/complexity score. Higher scores reveal hotspots where
44
> refactorings should happen.
55
6-
[![Style Status][style-image]][style-url]
6+
[![CI][gh-actions-image]][gh-ci-url]
77
[![NPM Version][npm-image]][npm-url]
8+
[![Style Status][style-image]][style-url]
89

910
Quoting Michael Feathers (source [here][michael-feathers-source]):
1011

@@ -107,12 +108,10 @@ A special thanks to a few contributors that helped me make `code-complexity` bet
107108
- Alexander Dormann (alexdo) for fixing the `ENOBUFS` (and apologies for stealing your code).
108109
- Scott Brooks (scottamplitude) for initiating the work on complexity strategies
109110

110-
[michael-feathers-source]: https://www.stickyminds.com/article/getting-empirical-about-refactoring
111-
[travis-image]: https://img.shields.io/travis/simonrenoult/code-complexity/master.svg?style=flat-square
112-
[travis-url]: https://travis-ci.org/simonrenoult/code-complexity
113-
[style-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square
111+
[gh-actions-image]: https://github.com/simonrenoult/code-complexity/actions/workflows/ci.yml/badge.svg
112+
[gh-ci-url]: https://github.com/simonrenoult/code-complexity/actions/workflows/ci.yml
114113
[style-url]: https://prettier.io/
115-
[coverage-image]: https://img.shields.io/codecov/c/github/simonrenoult/code-complexity.svg?style=flat-square
116-
[coverage-url]: https://codecov.io/gh/simonrenoult/code-complexity/branch/master
114+
[style-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square
117115
[npm-image]: https://img.shields.io/npm/v/code-complexity.svg?style=flat-square
118116
[npm-url]: https://www.npmjs.com/package/code-complexity
117+
[michael-feathers-source]: https://www.stickyminds.com/article/getting-empirical-about-refactoring

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
},
2424
"scripts": {
2525
"build": "rm -rf dist && tsc",
26-
"prepublish": "npm run verify",
2726
"start": "node dist/bin/code-complexity.js",
2827
"test": "node --test --require=ts-node/register test/**/*.ts",
2928
"verify": "prettier --check . && eslint . && npm run test && npm run build"

test/fixtures/test-repository.fixture.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ export default class TestRepositoryFixture {
4141
rmSync(this.location, { recursive: true });
4242
}
4343
mkdirSync(this.location);
44+
execSync(`git config --global user.email "[email protected]"`);
45+
execSync(`git config --global user.name "John Doe"`);
46+
execSync(`git config --global init.defaultBranch main`);
4447
execSync(`git -C ${this.location} init`);
4548

4649
this.#files.forEach((file) => {

0 commit comments

Comments
 (0)