From 3d1a3fd7cfc8c68016faaa0d06daf34d9d0d7ea8 Mon Sep 17 00:00:00 2001 From: Paul Mineev Date: Wed, 13 Jul 2022 11:23:29 -0700 Subject: [PATCH] update ci workflows --- .../{ci-test-backend.yml => ci-backend.yml} | 8 ++- .github/workflows/ci-build.yml | 4 +- .github/workflows/ci-frontend-size-limit.yml | 30 --------- .github/workflows/ci-frontend.yml | 62 +++++++++++++------ .github/workflows/ci-site.yml | 7 ++- 5 files changed, 56 insertions(+), 55 deletions(-) rename .github/workflows/{ci-test-backend.yml => ci-backend.yml} (94%) delete mode 100644 .github/workflows/ci-frontend-size-limit.yml diff --git a/.github/workflows/ci-test-backend.yml b/.github/workflows/ci-backend.yml similarity index 94% rename from .github/workflows/ci-test-backend.yml rename to .github/workflows/ci-backend.yml index 6bf14c3c..d19c3b2d 100644 --- a/.github/workflows/ci-test-backend.yml +++ b/.github/workflows/ci-backend.yml @@ -1,4 +1,4 @@ -name: test_backend +name: backend on: push: @@ -10,17 +10,19 @@ on: - "!backend/scripts/**" - "!**.md" pull_request: + types: [opened, reopened] paths: - ".github/workflows/ci-test-backend.yml" - "backend/**" - "!backend/scripts/**" - "!**.md" jobs: - test-backend: + test: + name: Test & Coverage runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: debug if needed run: if [[ "$DEBUG" == "true" ]]; then env; fi diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 6b602179..d21c986a 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -3,6 +3,7 @@ name: build on: push: branches: + - master tags: paths: - ".github/workflows/ci-build.yml" @@ -24,10 +25,11 @@ on: jobs: build-images: + name: Build Docker images runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: set up QEMU uses: docker/setup-qemu-action@v1 diff --git a/.github/workflows/ci-frontend-size-limit.yml b/.github/workflows/ci-frontend-size-limit.yml deleted file mode 100644 index e56aaccb..00000000 --- a/.github/workflows/ci-frontend-size-limit.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: frontend - -on: - pull_request: - paths: - - ".github/workflows/ci-frontend-size-limit.yml" - - "frontend/apps/remark42/**" - - "!**.md" - -jobs: - size: - runs-on: ubuntu-latest - env: - CI_JOB_NUMBER: 1 - steps: - - name: Checkout - uses: actions/checkout@v1 - - - name: Install pnpm - uses: pnpm/action-setup@v2.0.1 - id: pnpm-install - with: - version: 7 - run_install: false - - - name: Check bundle size - uses: andresz1/size-limit-action@v1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - directory: ./frontend/apps/remark42 diff --git a/.github/workflows/ci-frontend.yml b/.github/workflows/ci-frontend.yml index 9f8837df..09c26649 100644 --- a/.github/workflows/ci-frontend.yml +++ b/.github/workflows/ci-frontend.yml @@ -3,7 +3,7 @@ name: frontend on: push: branches: - tags: + - master paths: - ".github/workflows/ci-frontend.yml" - "frontend/apps/remark42/**" @@ -15,7 +15,8 @@ on: - "!**.md" jobs: - check-translations: + translations-check: + name: Translations check runs-on: ubuntu-latest strategy: matrix: @@ -23,10 +24,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install node - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} @@ -51,14 +52,15 @@ jobs: ${{ runner.os }}-pnpm-store- - name: Install dependencies - run: pnpm i --loglevel warn + run: pnpm i working-directory: ./frontend - - name: Run translations check + - name: Translations check run: pnpm translation-check working-directory: ./frontend/apps/remark42 - check-typescript: + type-check: + name: Type check runs-on: ubuntu-latest strategy: matrix: @@ -66,10 +68,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install node - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} @@ -94,7 +96,7 @@ jobs: ${{ runner.os }}-pnpm-store- - name: Install dependencies - run: pnpm i --loglevel warn + run: pnpm i working-directory: ./frontend - name: Run type check @@ -102,6 +104,7 @@ jobs: working-directory: ./frontend/apps/remark42 lint: + name: Eslint & Stylelint runs-on: ubuntu-latest strategy: matrix: @@ -109,10 +112,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install node - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} @@ -137,14 +140,37 @@ jobs: ${{ runner.os }}-pnpm-store- - name: Install dependencies - run: pnpm i --loglevel warn + run: pnpm i working-directory: ./frontend - name: Run linters run: pnpm lint working-directory: ./frontend/apps/remark42 + size-limit: + name: Size limit + runs-on: ubuntu-latest + env: + CI_JOB_NUMBER: 1 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install pnpm + uses: pnpm/action-setup@v2.0.1 + id: pnpm-install + with: + version: 7 + run_install: false + + - name: Check bundle size + uses: andresz1/size-limit-action@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + directory: ./frontend/apps/remark42 + test: + name: Tests & Coverage runs-on: ubuntu-latest strategy: matrix: @@ -152,10 +178,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install node - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} @@ -180,11 +206,11 @@ jobs: ${{ runner.os }}-pnpm-store- - name: Install dependencies - run: pnpm i --loglevel warn + run: pnpm i working-directory: ./frontend - - name: Collect tests coverage - run: pnpm run test --coverage + - name: Test & Coverage + run: pnpm coverage working-directory: ./frontend/apps/remark42 - name: Submit coverage diff --git a/.github/workflows/ci-site.yml b/.github/workflows/ci-site.yml index 817924e6..f74f041e 100644 --- a/.github/workflows/ci-site.yml +++ b/.github/workflows/ci-site.yml @@ -3,6 +3,7 @@ name: site on: push: branches: + - master tags: paths: - ".github/workflows/ci-site.yml" @@ -13,13 +14,13 @@ on: - "site/**" jobs: - - build-site: + build: + name: Build runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: set up QEMU uses: docker/setup-qemu-action@v1