From 3dd9024cc7663532223322a589691455e84f1cbb Mon Sep 17 00:00:00 2001 From: Michael C Date: Mon, 20 Dec 2021 23:04:41 -0500 Subject: [PATCH] eslint + workflow formatting - appropriate job names - only trigger on pushes to master branch & PRs - conform to formatting --- .github/workflows/ci.yml | 9 ++++++--- .github/workflows/eslint.yml | 9 ++++++--- .github/workflows/generate-sqlite-base.yml | 5 +++++ .github/workflows/postgres-redis-ci.yml | 8 ++++++-- .github/workflows/take-action.yml | 12 +++++------- src/app.ts | 1 - test/cases/ratings/getRating.ts | 2 +- test/cases/redisTest.ts | 4 ++-- 8 files changed, 31 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d938520..619bb9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,13 @@ name: SQLite CI -on: [push, pull_request] +on: + push: + branches: + - master + pull_request: jobs: - build: + test: name: Run Tests with SQLite runs-on: ubuntu-latest @@ -12,7 +16,6 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 - run: npm install - - name: Run Tests timeout-minutes: 5 run: npm test diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 38c42c4..fab273b 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -1,9 +1,13 @@ name: Linting -on: [push, pull_request] +on: + push: + branches: + - master + pull_request: jobs: - build: + lint: name: Lint with ESLint runs-on: ubuntu-latest @@ -12,7 +16,6 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 - run: npm install - - name: Run Tests timeout-minutes: 5 run: npm run lint \ No newline at end of file diff --git a/.github/workflows/generate-sqlite-base.yml b/.github/workflows/generate-sqlite-base.yml index 9f1a68e..53f1703 100644 --- a/.github/workflows/generate-sqlite-base.yml +++ b/.github/workflows/generate-sqlite-base.yml @@ -1,12 +1,17 @@ name: create-sqlite-base + on: push: + branches: + - master paths: - databases/** jobs: make-base-db: + name: Generate SQLite base .db runs-on: ubuntu-latest + steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 diff --git a/.github/workflows/postgres-redis-ci.yml b/.github/workflows/postgres-redis-ci.yml index 28a19f2..44500f8 100644 --- a/.github/workflows/postgres-redis-ci.yml +++ b/.github/workflows/postgres-redis-ci.yml @@ -1,9 +1,13 @@ name: PostgreSQL + Redis CI -on: [push, pull_request] +on: + push: + branches: + - master + pull_request: jobs: - build: + test: name: Run Tests with PostgreSQL and Redis runs-on: ubuntu-latest diff --git a/.github/workflows/take-action.yml b/.github/workflows/take-action.yml index c5b6f1f..4529ffa 100644 --- a/.github/workflows/take-action.yml +++ b/.github/workflows/take-action.yml @@ -1,14 +1,12 @@ -# .github/workflows/take.yml name: Assign issue to contributor -on: - issue_comment: +on: [issue_comment] jobs: assign: name: Take an issue runs-on: ubuntu-latest steps: - - name: take the issue - uses: bdougie/take-action@main - env: - GITHUB_TOKEN: ${{ github.token }} + - name: take the issue + uses: bdougie/take-action@main + env: + GITHUB_TOKEN: ${{ github.token }} diff --git a/src/app.ts b/src/app.ts index 4f6e1f7..23ed171 100644 --- a/src/app.ts +++ b/src/app.ts @@ -46,7 +46,6 @@ import { getChapterNames } from "./routes/getChapterNames"; import { postRating } from "./routes/ratings/postRating"; import { getRating } from "./routes/ratings/getRating"; import { postClearCache as ratingPostClearCache } from "./routes/ratings/postClearCache"; -import path from "path"; export function createServer(callback: () => void): Server { // Create a service (the app object is just a callback). diff --git a/test/cases/ratings/getRating.ts b/test/cases/ratings/getRating.ts index 1ab3737..0f63ba7 100644 --- a/test/cases/ratings/getRating.ts +++ b/test/cases/ratings/getRating.ts @@ -59,7 +59,7 @@ describe("getRating", () => { }); /* - This test will fail if tests are already ran with redis. + This test will fail if tests are already ran with redis. */ it("Should be able to bulk fetch", (done) => { getBulkRating([videoOnePartialHash, videoTwoPartialHash]) diff --git a/test/cases/redisTest.ts b/test/cases/redisTest.ts index cc99edc..3ab238d 100644 --- a/test/cases/redisTest.ts +++ b/test/cases/redisTest.ts @@ -25,8 +25,8 @@ describe("redis test", function() { it("Should not be able to get not stored value", (done) => { redis.getAsync(randKey2) .then(res => { - if (res.reply || res.err ) assert.fail("Value should not be found") + if (res.reply || res.err ) assert.fail("Value should not be found"); done(); }); - }) + }); }); \ No newline at end of file