Skip to content

Commit

Permalink
ci: migrate to zx-semrel
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Oct 28, 2023
1 parent b184fb2 commit bab9624
Showing 1 changed file with 24 additions and 48 deletions.
72 changes: 24 additions & 48 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: CI
on: [push, pull_request]
jobs:
test_push:
name: Test on push
name: Push
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-22.04
steps:
Expand All @@ -22,10 +22,31 @@ jobs:
- name: Run Node.js tests
run: npm run test

- name: Codeclimate
if: github.ref == 'refs/heads/master'
uses: paambaati/codeclimate-action@v5.0.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: |
${{github.workspace}}/target/coverage/lcov.info:lcov
- name: Semantic Release
if: github.ref == 'refs/heads/master'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_PROVENANCE: true
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
run: npm_config_yes=true npx zx-semrel

test_pr_bun:
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-22.04
name: Test PR with Bun
name: PR with Bun
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
Expand All @@ -44,7 +65,7 @@ jobs:

test_pr_node:
if: ${{ github.event_name == 'pull_request' }}
name: Test PR Node.js v${{ matrix.node-version }}, OS ${{ matrix.os }}
name: PR Node.js v${{ matrix.node-version }}, OS ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-22.04, windows-2022 ]
Expand Down Expand Up @@ -73,48 +94,3 @@ jobs:
- name: Run tests
timeout-minutes: 2
run: npm run test

release:
name: Release
# https://git.luolix.topmunity/t/trigger-job-on-tag-push-only/18076
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: [test_push]
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
with:
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- name: Deps
run: npm i

- name: Run tests
run: npm run test:cov

- name: Docs
run: npm run docs

- name: Codeclimate
uses: paambaati/codeclimate-action@v3.0.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: |
${{github.workspace}}/coverage/*.lcov:lcov
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_AUTHOR_EMAIL: 'mailbox@antongolub.ru'
GIT_COMMITTER_EMAIL: 'mailbox@antongolub.ru'
GIT_AUTHOR_NAME: '@antongolub'
GIT_COMMITTER_NAME: '@antongolub'
run: npm_config_yes=true npx -p @qiwi/semrel-toolkit semrel

0 comments on commit bab9624

Please sign in to comment.