forked from cerc-io/cosmos-explorer
Add lint and build gitea workflow
This commit is contained in:
parent
f36a6bb87c
commit
c1d8068823
61
.gitea/workflows/lint-and-build.yml
Normal file
61
.gitea/workflows/lint-and-build.yml
Normal file
@ -0,0 +1,61 @@
|
||||
name: Lint and Build
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- dev
|
||||
paths:
|
||||
- 'src/**'
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20.x'
|
||||
|
||||
- name: Enable corepack and yarn
|
||||
run: corepack enable
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Run Prettier format check
|
||||
run: yarn prettier --check .
|
||||
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
needs: lint
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20.x'
|
||||
|
||||
- name: Enable corepack and yarn
|
||||
run: corepack enable
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Build project
|
||||
run: yarn build
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-artifacts
|
||||
path: dist/
|
||||
retention-days: 7
|
||||
@ -89,7 +89,7 @@ function suggest() {
|
||||
window.unisat
|
||||
.experimentalSuggestChain(JSON.parse(conf.value))
|
||||
.catch((e: unknown) => {
|
||||
error.value = e instanceof Error ? e.message : String(e);
|
||||
error.value = e instanceof Error ? e.message : String(e);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user