Skip to content

chore(deps): update devdependencies (non-major) #289

chore(deps): update devdependencies (non-major)

chore(deps): update devdependencies (non-major) #289

Workflow file for this run

name: Main
on:
push:
branches:
- main
jobs:
commit-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Commit Lint
uses: wagoid/commitlint-github-action@v5
code-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4.0.2
with:
node-version: '20'
- uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-16-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Format
run: yarn run format
- name: Lint
run: yarn run lint
test-with-node:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 16, 18, 20 ]
steps:
- uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4.0.2
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-${{ matrix.node-version }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-engines
- name: Run Tests
run: yarn test
- name: Run Tests with different timezones
run: yarn test:with-different-timezones
- name: Run Tests with coverage
run: yarn test:coverage
- name: Post coverage results to coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-with-node-version-${{ matrix.node-version }}
parallel: true
complete-coverage-results:
needs: test-with-node
runs-on: ubuntu-latest
steps:
- name: Finish coveralls parallel build
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
release:
if: "!contains(github.event.commits[0].message, '[skip ci]')"
needs: [commit-lint, code-lint, test-with-node]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Node.js environment
uses: actions/setup-node@v4.0.2
with:
node-version: '20'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build
run: yarn build
- name: Disable protection temporary
uses: actions/github-script@v7.0.1
with:
github-token: '${{ secrets.GASTROBOT_TOKEN}}'
script: |
await github.rest.repos.deleteAdminBranchProtection({
repo: '${{ github.event.repository.name }}',
owner: '${{ github.repository_owner }}',
branch: 'main',
});
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GASTROBOT_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Restore protection
uses: actions/github-script@v7.0.1
if: always()
with:
github-token: '${{ secrets.GASTROBOT_TOKEN}}'
script: |
await github.rest.repos.setAdminBranchProtection({
repo: '${{ github.event.repository.name }}',
owner: '${{ github.repository_owner }}',
branch: 'main',
});