From ed90681a9f359a38544f7e9c86b0688e8e847b75 Mon Sep 17 00:00:00 2001 From: Polybius93 Date: Mon, 6 Nov 2023 17:04:59 +0100 Subject: [PATCH] feat: updated actions --- .github/actions/provision/action.yml | 24 ++++ .github/workflows/code-checks.yml | 103 ++++++++++++++++++ .github/workflows/playwright.yml | 4 +- .../components/gt-action-test-component.tsx | 2 +- 4 files changed, 130 insertions(+), 3 deletions(-) create mode 100644 .github/actions/provision/action.yml create mode 100644 .github/workflows/code-checks.yml diff --git a/.github/actions/provision/action.yml b/.github/actions/provision/action.yml new file mode 100644 index 00000000..1af8bb3b --- /dev/null +++ b/.github/actions/provision/action.yml @@ -0,0 +1,24 @@ +name: Provision +description: Set up job with tasks needed to run a code check +runs: + using: 'composite' + steps: + - name: Set up node + uses: actions/setup-node@v3 + with: + node-version: 18 + + - uses: actions/cache@v3 + id: cache + with: + path: '**/node_modules' + key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }} + + - uses: nick-fields/retry@v2 + if: steps.cache.outputs.cache-hit != 'true' + env: + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 + with: + timeout_minutes: 5 + max_attempts: 3 + command: yarn --frozen-lockfile diff --git a/.github/workflows/code-checks.yml b/.github/workflows/code-checks.yml new file mode 100644 index 00000000..2cf3fa8f --- /dev/null +++ b/.github/workflows/code-checks.yml @@ -0,0 +1,103 @@ +name: Code Checks + +on: + merge_group: + push: + branches: + - '**' + +jobs: + lint-eslint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/provision + + - name: Lint + run: yarn lint:eslint + + lint-filename: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/provision + + - name: File name checker + run: yarn lint:filename + + lint-prettier: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/provision + + - name: Lint + run: yarn lint:prettier + + lint-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Lint commit message + uses: wagoid/commitlint-github-action@v4 + + lint-deps: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/provision + + - name: Lint dependency rules + run: yarn lint:deps + + lint-unused-exports: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/provision + + - name: Lint unused TypeScript exports + run: yarn lint:unused-exports + + locked-versions: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/provision + + - name: Check exact versions + uses: ./.github/actions/check-version-lock + + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/provision + + - name: Typecheck + run: yarn typecheck + + test-unit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/provision + + - name: Test + run: yarn test:unit + + test-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/provision + + - name: Build + run: yarn build + + - name: Package extension + run: sh build-ext.sh + shell: bash diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 84fcefe6..5c9dc286 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -1,9 +1,9 @@ name: Playwright Tests on: push: - branches: [ main, master, dev ] + branches: [ dev ] pull_request: - branches: [ main, master, dev ] + branches: [ dev ] jobs: test: timeout-minutes: 60 diff --git a/src/app/components/gt-action-test-component.tsx b/src/app/components/gt-action-test-component.tsx index 46db25bb..80e40433 100644 --- a/src/app/components/gt-action-test-component.tsx +++ b/src/app/components/gt-action-test-component.tsx @@ -5,7 +5,7 @@ import React from "react"; export function GithubActionTestComponents(): React.JSX.Element { return ( - {/* GithubActionTestComponents */} + GithubActionTestComponents ); }