From a4362cf78b538e0044d09bf0c59d9bb0797a1617 Mon Sep 17 00:00:00 2001 From: 3y3 <3y3@ya.ru> Date: Mon, 18 Dec 2023 18:59:48 +0300 Subject: [PATCH] chore: Add github workflows --- .github/workflows/quality.yaml | 22 ++++++++++++++++++++++ .github/workflows/release.yaml | 19 +++++++++++++++++++ .github/workflows/tests.yaml | 22 ++++++++++++++++++++++ package.json | 3 ++- 4 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/quality.yaml create mode 100644 .github/workflows/release.yaml create mode 100644 .github/workflows/tests.yaml diff --git a/.github/workflows/quality.yaml b/.github/workflows/quality.yaml new file mode 100644 index 0000000..17dd2fa --- /dev/null +++ b/.github/workflows/quality.yaml @@ -0,0 +1,22 @@ +name: Code quality + +on: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: "npm" + - run: npm ci + - run: npm run lint diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..3ae38e9 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,19 @@ +on: + push: + branches: [master] + +name: release + +permissions: + contents: write + pull-requests: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: yandex-cloud/ui-release-action@main + with: + github-token: ${{ secrets.YC_UI_BOT_GITHUB_TOKEN }} + npm-token: ${{ secrets.ROBOT_DATAUI_NPM_TOKEN }} + node-version: 18 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..addf55e --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,22 @@ +name: Unit tests + +on: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: "npm" + - run: npm ci + - run: npm run test diff --git a/package.json b/package.json index 274946f..1ae4ad4 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"", "lint:fix": "npm run lint -- --fix", "build": "webpack && tsc --emitDeclarationOnly --outDir build", - "prepublishOnly": "rm -rf build && npm ci --no-workspaces && npm run build" + "prepublishOnly": "rm -rf build && npm ci --no-workspaces && npm run build", + "test": "exit 0" }, "author": "", "license": "ISC",