CI #30
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: CI | |
on: | |
workflow_dispatch: | |
inputs: | |
revision: | |
description: 'The revision to run CI on.' | |
required: false | |
default: main | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: read | |
pull-requests: read | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.inputs.revision }} | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'yarn' | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Run format checks | |
if: success() || failure() | |
run: 'yarn format:check' | |
- name: Run linter | |
if: success() || failure() | |
run: 'yarn lint:check' | |
- name: Run tests | |
if: success() || failure() | |
env: | |
NODE_ENV: test | |
run: 'yarn test:ci' | |
package-action: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
needs: | |
- ci | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.inputs.revision }} | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'yarn' | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Package action | |
run: yarn ci:package | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: 'chore: Package action' | |
commit_options: '--no-verify --signoff' | |
file_pattern: dist/ | |
disable_globbing: true | |
push_options: '--force' |