From 923e1c2f84e4895e8e3c7b0c44774756812063a8 Mon Sep 17 00:00:00 2001 From: Gleb Voitenko Date: Thu, 29 Aug 2024 01:34:05 +0300 Subject: [PATCH] feat: add actions --- .github/dependabot.yml | 14 +++++++++++++ .github/workflows/ci.yml | 26 ++++++++++++++++++++++++ .github/workflows/release.yml | 36 ++++++++++++++++++++++++++++++++++ .github/workflows/tests.yml | 37 +++++++++++++++++++++++++++++++++++ 4 files changed, 113 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/tests.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..f3fd52a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + reviewers: + - "diplodoc-platform/devops" + open-pull-requests-limit: 5 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2783a74 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,26 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + verify_files: + name: Verify Files + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '18.x' + cache: 'npm' + - name: Install Packages + run: npm ci + - name: Lint Files + run: npm run lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7cc971b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +on: + push: + branches: [master] + +name: release + +permissions: + contents: write + pull-requests: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + node-version: 18 + registry-url: 'https://registry.npmjs.org' + - run: npm ci + shell: bash + - uses: codex-team/action-nodejs-package-info@v1 + id: package + - uses: GoogleCloudPlatform/release-please-action@v3 + id: release + with: + token: ${{secrets.YC_UI_BOT_GITHUB_TOKEN}} + release-type: node + package-name: ${{steps.package.outputs.name}} + changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"perf","section":"Performance Improvements","hidden":false}]' + bump-minor-pre-major: true + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.ROBOT_DATAUI_NPM_TOKEN}} + if: ${{ steps.release.outputs.release_created }} + shell: bash diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..480664a --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,37 @@ +name: Tests + +on: + push: + branches: [master] + pull_request: + branches: ['**'] + +jobs: + test: + name: Node v${{ matrix.node-version }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + node-version: [18.x] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + os: ${{ matrix.os }} + cache: 'npm' + - name: Install packages for project + run: npm ci + - run: npm run build + - name: Install packages for tests + run: | + cd tests + npm ci + - name: Run tests + run: | + cd tests + npm run test