From a0f3afa342fe8de34c402d9ea488ff1729104807 Mon Sep 17 00:00:00 2001 From: mog13 <0Y#S^sX5pIGuTB3s> Date: Tue, 31 Oct 2023 20:21:35 +0000 Subject: [PATCH 1/3] - add an action for linting, testing and code coverage --- .github/workflows/testAndCoverage.yml | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/testAndCoverage.yml diff --git a/.github/workflows/testAndCoverage.yml b/.github/workflows/testAndCoverage.yml new file mode 100644 index 0000000..480dca2 --- /dev/null +++ b/.github/workflows/testAndCoverage.yml @@ -0,0 +1,33 @@ +name: Test, lint and Code Coverage + +on: [ push, pull_request ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [ 10.x, 12.x, 14.x ] + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Install dependencies + run: npm install + + - name: Lint the code + run: npm run lint + + - name: Run the tests + run: npm test -- --coverage + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 \ No newline at end of file From 1b71c9699ead5f06ee14c21ba1f7197fa34012a5 Mon Sep 17 00:00:00 2001 From: mog13 <0Y#S^sX5pIGuTB3s> Date: Tue, 31 Oct 2023 20:30:40 +0000 Subject: [PATCH 2/3] - use lf for line endings - dont use matrix for Node version in gh actions --- .github/workflows/testAndCoverage.yml | 8 ++------ .prettierrc.json | 3 +++ package.json | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) create mode 100644 .prettierrc.json diff --git a/.github/workflows/testAndCoverage.yml b/.github/workflows/testAndCoverage.yml index 480dca2..fdc0bd2 100644 --- a/.github/workflows/testAndCoverage.yml +++ b/.github/workflows/testAndCoverage.yml @@ -1,16 +1,12 @@ name: Test, lint and Code Coverage -on: [ push, pull_request ] +on: [ push ] jobs: build: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [ 10.x, 12.x, 14.x ] - steps: - name: Checkout repository uses: actions/checkout@v2 @@ -18,7 +14,7 @@ jobs: - name: Set up Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: - node-version: ${{ matrix.node-version }} + node-version: 14.x - name: Install dependencies run: npm install diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..b84e3ef --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "endOfLine": "lf" +} \ No newline at end of file diff --git a/package.json b/package.json index 46057b4..3e61c50 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "random", "dx" ], - "author": "Morgan Owen", + "author": "Morgan Sands", "license": "MIT", "bugs": { "url": "https://github.com/mog13/DXJS/issues" From 67d519c91e032a1f796e5f6dc54430d6e6d4a265 Mon Sep 17 00:00:00 2001 From: mog13 <0Y#S^sX5pIGuTB3s> Date: Tue, 31 Oct 2023 20:34:04 +0000 Subject: [PATCH 3/3] - use node v 20 --- .github/workflows/testAndCoverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testAndCoverage.yml b/.github/workflows/testAndCoverage.yml index fdc0bd2..16d59b3 100644 --- a/.github/workflows/testAndCoverage.yml +++ b/.github/workflows/testAndCoverage.yml @@ -14,7 +14,7 @@ jobs: - name: Set up Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: - node-version: 14.x + node-version: 20.x - name: Install dependencies run: npm install