From 94c1bee44ccc1061af518266a0c902a70b90156a Mon Sep 17 00:00:00 2001 From: Krzysztof Wolski Date: Mon, 8 Jun 2020 13:50:47 +0200 Subject: [PATCH 1/4] Add gh actions --- .circleci/config.yml | 6 ---- .github/workflows/test.yml | 71 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index d600bff95..7cd104157 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,12 +22,6 @@ jobs: - run: name: Build application command: npm run build - - run: - name: Package lock security test - command: npx lockfile-lint --path package-lock.json --allowed-hosts npm - - run: - name: Run linters - command: npm run lint - run: name: Install Lighthouse tools command: sudo npm install -g @lhci/cli diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..118feae95 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,71 @@ +name: QA + +on: + pull_request: + branches: ["*"] + +jobs: + check-lock: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Validate lock file + run: | + npx lockfile-lint --path package-lock.json --allowed-hosts npm yarn + + tsc-and-linters: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Cache node modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-qa-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-qa-${{ env.cache-name }}- + ${{ runner.os }}-qa- + ${{ runner.os }}- + + - name: Install deps + run: | + npm ci + + - name: Run tsc + run: | + npm run tsc + + - name: Run lint + run: | + npm run lint + + jest-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Cache node modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-qa-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-qa-${{ env.cache-name }}- + ${{ runner.os }}-qa- + ${{ runner.os }}- + + - name: Install deps + run: | + npm ci + + - name: Run jest + run: | + npm run test From 9481334afa08ad96c601445fca66edbd4276e878 Mon Sep 17 00:00:00 2001 From: Krzysztof Wolski Date: Mon, 8 Jun 2020 14:27:56 +0200 Subject: [PATCH 2/4] Add action for translation messages --- .github/workflows/test.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 118feae95..ef20f7ab8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -69,3 +69,30 @@ jobs: - name: Run jest run: | npm run test + + translation-messages: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Cache node modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-qa-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-qa-${{ env.cache-name }}- + ${{ runner.os }}-qa- + ${{ runner.os }}- + + - name: Install deps + run: | + npm ci + + - name: Check message extraction + run: | + npm run extract-messages + git diff ./locale From 0205ac1609706733d9a99eee181c63ded9775f26 Mon Sep 17 00:00:00 2001 From: Krzysztof Wolski Date: Mon, 8 Jun 2020 15:58:15 +0200 Subject: [PATCH 3/4] Update actions --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ef20f7ab8..fac65e198 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: - name: Run tsc run: | - npm run tsc + npm run check-types - name: Run lint run: | @@ -95,4 +95,4 @@ jobs: - name: Check message extraction run: | npm run extract-messages - git diff ./locale + git diff --exit-code ./locale From 598e1af563023d8c9d134757a7b9b9f45b5c86eb Mon Sep 17 00:00:00 2001 From: Krzysztof Wolski Date: Mon, 8 Jun 2020 17:00:39 +0200 Subject: [PATCH 4/4] Bump node version --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7cd104157..0e1d28804 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build-lint-benchmark: docker: - - image: circleci/node:10.7.0-browsers + - image: circleci/node:14.4.0-browsers steps: - checkout - restore_cache: