From 57f1734bf3ac941dc5b74ab3dac3dfb18000cb83 Mon Sep 17 00:00:00 2001 From: galta95 <48960890+galta95@users.noreply.github.com> Date: Sun, 29 Nov 2020 15:46:07 +0200 Subject: [PATCH] ci(tests): added unit tests and lint workflows (#11) * ci(tests): added unit tets * fix(github- workflows): split to two different .yml files for each job category --- .github/workflows/{main.yml => lint.yml} | 15 +++++++------- .github/workflows/tests.yml | 26 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 8 deletions(-) rename .github/workflows/{main.yml => lint.yml} (60%) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/main.yml b/.github/workflows/lint.yml similarity index 60% rename from .github/workflows/main.yml rename to .github/workflows/lint.yml index 39acaf9..b191039 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/lint.yml @@ -1,14 +1,14 @@ name: Lint -on: [pull_request] +on: [push, pull_request] jobs: eslint: - name: Run eslint + name: Run TS Project eslint runs-on: ubuntu-latest steps: - - name: Check out Git repository + - name: Check out TS Project Git repository uses: actions/checkout@v2 - name: Set up Node.js @@ -16,15 +16,14 @@ jobs: with: node-version: 12 - # ESLint and Prettier must be in `package.json` - name: Install Node.js dependencies run: npm install - - name: Run linters - uses: samuelmeuli/lint-action@v1 + - name: Run TS Project linters + uses: wearerequired/lint-action@v1 with: github_token: ${{ secrets.github_token }} # Enable linters eslint: true - eslint_extensions: ts - # prettier: true \ No newline at end of file + eslint_dir: ./src + eslint_extensions: ts \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..bb34e1b --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,26 @@ +name: Tests + +on: [push, pull_request] + +jobs: + tests: + name: Run TS Project eslint + runs-on: ubuntu-latest + + steps: + - name: Check out TS Project Git repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v1 + with: + node-version: 12 + + - name: Install Node.js dependencies + run: npm install + + - name: Run unit tests + uses: actions/checkout@v2 + run: npm run unit-tests + with: + github_token: ${{ secrets.github_token }}