refactor: upgrade CI #75
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Main workflow | |
on: push | |
jobs: | |
test: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, macos-12, windows-2022] | |
version: [ 16, 18 ] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup NodeJS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.version }} | |
cache: 'npm' | |
- name: Dependency installation | |
run: npm ci | |
- name: Linting | |
run: npm run lint | |
- name: Integration tests | |
run: npm run test | |
publish: | |
runs-on: ubuntu-20.04 | |
needs: test | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup NodeJS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
- name: Dependency installation | |
run: npm ci | |
- name: Checking typescript types and build app | |
run: npm run build | |
- name: Publish to NPM | |
run: npx semantic-release | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |