From 2f89684f0fc03822fd6dd91aaf96b2c4e8035c09 Mon Sep 17 00:00:00 2001 From: Alan Churley Date: Wed, 28 Oct 2020 16:54:27 +0000 Subject: [PATCH 1/4] Pushing broken test --- src/__tests__/Greeter.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/__tests__/Greeter.test.ts b/src/__tests__/Greeter.test.ts index b797375e32..45c99a91d7 100644 --- a/src/__tests__/Greeter.test.ts +++ b/src/__tests__/Greeter.test.ts @@ -2,6 +2,6 @@ import { Hello } from '../index'; describe('Simple expression tests', () => { test('Hello', () => { expect(Hello('Carl')).toBe('Hello Carl'); - expect(Hello()).toBe('Hello unknown person'); + expect(Hello()).toBe('Not Hello unknown person'); }); }); From 3d92badcfe82f97b9eb059c2754acabc4847069e Mon Sep 17 00:00:00 2001 From: Alan Churley Date: Wed, 28 Oct 2020 17:02:45 +0000 Subject: [PATCH 2/4] Adding coverage reporter --- .github/workflows/pullRequest.yml | 21 +++++++++++++++++++++ .github/workflows/test.yml | 2 -- src/__tests__/Greeter.test.ts | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/pullRequest.yml diff --git a/.github/workflows/pullRequest.yml b/.github/workflows/pullRequest.yml new file mode 100644 index 0000000000..97f90efafc --- /dev/null +++ b/.github/workflows/pullRequest.yml @@ -0,0 +1,21 @@ +name: Test +on: + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install modules + run: npm install + - name: Run lint + run: npm run lint + - name: Run tests + run: npm run test + - name: Report Coverage + uses: romeovs/lcov-reporter-action@v0.2.11 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + lcov-file: ./coverage/lcov.info diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 214edaefa8..a94da4e018 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,8 +2,6 @@ name: Test on: push: branches: [ main ] - pull_request: - branches: [ main ] jobs: test: diff --git a/src/__tests__/Greeter.test.ts b/src/__tests__/Greeter.test.ts index 45c99a91d7..b797375e32 100644 --- a/src/__tests__/Greeter.test.ts +++ b/src/__tests__/Greeter.test.ts @@ -2,6 +2,6 @@ import { Hello } from '../index'; describe('Simple expression tests', () => { test('Hello', () => { expect(Hello('Carl')).toBe('Hello Carl'); - expect(Hello()).toBe('Not Hello unknown person'); + expect(Hello()).toBe('Hello unknown person'); }); }); From ac99246fc8bef3f1aaad65a23e0075b898632a79 Mon Sep 17 00:00:00 2001 From: Alan Churley Date: Wed, 28 Oct 2020 17:15:01 +0000 Subject: [PATCH 3/4] Adding codeql --- .github/workflows/codeql-analysis.yml | 40 +++++++++++++++++++++++++++ .github/workflows/pullRequest.yml | 21 -------------- .github/workflows/test.yml | 8 ++++++ 3 files changed, 48 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/codeql-analysis.yml delete mode 100644 .github/workflows/pullRequest.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000000..3f7a07a67d --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,40 @@ +name: "CodeQL" + +on: + push: + branches: [main] + pull_request: + branches: [main] + schedule: + - cron: '0 21 * * 0' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + # Override automatic language detection by changing the below list + # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] + language: ['javascript'] + # Learn more... + # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/pullRequest.yml b/.github/workflows/pullRequest.yml deleted file mode 100644 index 97f90efafc..0000000000 --- a/.github/workflows/pullRequest.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Test -on: - pull_request: - branches: [ main ] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install modules - run: npm install - - name: Run lint - run: npm run lint - - name: Run tests - run: npm run test - - name: Report Coverage - uses: romeovs/lcov-reporter-action@v0.2.11 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - lcov-file: ./coverage/lcov.info diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a94da4e018..2fc1fb0c25 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,6 +2,8 @@ name: Test on: push: branches: [ main ] + pull_request: + branches: [ main ] jobs: test: @@ -14,3 +16,9 @@ jobs: run: npm run lint - name: Run tests run: npm run test + - name: Report Coverage + if: ${{ github.event_name == 'pull_request' }} + uses: romeovs/lcov-reporter-action@v0.2.11 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + lcov-file: ./coverage/lcov.info \ No newline at end of file From 1e3403ec816d1527efaa6cc4fc35134f93aa5858 Mon Sep 17 00:00:00 2001 From: Alan Churley Date: Wed, 28 Oct 2020 17:26:15 +0000 Subject: [PATCH 4/4] Removing codeql, until repo is public --- .github/workflows/codeql-analysis.yml | 80 +++++++++++++-------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 3f7a07a67d..e2a31a4a04 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,40 +1,40 @@ -name: "CodeQL" - -on: - push: - branches: [main] - pull_request: - branches: [main] - schedule: - - cron: '0 21 * * 0' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - # Override automatic language detection by changing the below list - # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] - language: ['javascript'] - # Learn more... - # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 +#name: "CodeQL" +# +#on: +# push: +# branches: [main] +# pull_request: +# branches: [main] +# schedule: +# - cron: '0 21 * * 0' +# +#jobs: +# analyze: +# name: Analyze +# runs-on: ubuntu-latest +# +# strategy: +# fail-fast: false +# matrix: +# # Override automatic language detection by changing the below list +# # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] +# language: ['javascript'] +# # Learn more... +# # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection +# +# steps: +# - name: Checkout repository +# uses: actions/checkout@v2 +# +# # Initializes the CodeQL tools for scanning. +# - name: Initialize CodeQL +# uses: github/codeql-action/init@v1 +# with: +# languages: ${{ matrix.language }} +# # If you wish to specify custom queries, you can do so here or in a config file. +# # By default, queries listed here will override any specified in a config file. +# # Prefix the list here with "+" to use these queries and those in the config file. +# # queries: ./path/to/local/query, your-org/your-repo/queries@main +# +# - name: Perform CodeQL Analysis +# uses: github/codeql-action/analyze@v1