fix: with command type (#80) #290
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: Build, Test and Deploy | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
env: | |
TZ: 'Europe/Paris' | |
NODE_VERSION: 16 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- uses: actions/cache@v3 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: install dependencies | |
run: yarn install --frozen-lockfile --non-interactive --production=false | |
- name: linting PR title | |
uses: JulienKode/pull-request-name-linter-action@900e046a8f2d6d0ba79bef8b6c731e4fe9f5fa8a | |
- name: lint Javascript | |
run: yarn lint | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
needs: [lint] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Cache node_modules | |
uses: actions/cache@v3 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Send coverage | |
uses: paambaati/codeclimate-action@ac3f177ece9928d220a8bd1c2f1957926fd3b67e | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |
with: | |
coverageCommand: yarn test:coverage | |
deploy: | |
name: Release package | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
needs: [test] | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false # GITHUB_TOKEN must not be set for the semantic release | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- uses: actions/cache@v3 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Semantic Release | |
uses: cycjimmy/semantic-release-action@719e6c4cc35efd3ac293b46d0dd60ea3a5fa9084 | |
id: semantic | |
with: | |
semantic_version: 17.4.2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} | |
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }} | |
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }} | |
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |