Skip to content

Commit 47808af

Browse files
committed
Add checks workflow
1 parent d7a7ff5 commit 47808af

File tree

4 files changed

+129
-4
lines changed

4 files changed

+129
-4
lines changed

Diff for: .github/workflows/checks.yml

+124
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# This workflow performs basic checks:
2+
#
3+
# 1. run a preparation step to install and cache node modules
4+
# 2. once prep succeeds, lint and test run in parallel
5+
#
6+
# The checks only run on non-draft Pull Requests. They don't run on the main
7+
# branch prior to deploy. It's recommended to use branch protection to avoid
8+
# pushes straight to 'main'.
9+
10+
name: Checks
11+
12+
on:
13+
pull_request:
14+
types:
15+
- opened
16+
- synchronize
17+
- reopened
18+
- ready_for_review
19+
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: true
23+
24+
jobs:
25+
prep:
26+
if: github.event.pull_request.draft == false
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Use Node.js ${{ env.NODE }}
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version-file: '.nvmrc'
37+
38+
- name: Cache node_modules
39+
uses: actions/cache@v4
40+
id: cache-node-modules
41+
with:
42+
path: node_modules
43+
key: ${{ runner.os }}-build-${{ hashFiles('**/package.json') }}
44+
45+
- name: Install
46+
run: npm install
47+
48+
lint:
49+
needs: prep
50+
runs-on: ubuntu-latest
51+
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v4
55+
56+
- name: Use Node.js ${{ env.NODE }}
57+
uses: actions/setup-node@v4
58+
with:
59+
node-version-file: '.nvmrc'
60+
61+
- name: Cache node_modules
62+
uses: actions/cache@v4
63+
id: cache-node-modules
64+
with:
65+
path: node_modules
66+
key: ${{ runner.os }}-build-${{ hashFiles('**/package.json') }}
67+
68+
- name: Install
69+
run: npm install
70+
71+
- name: Lint
72+
run: npm run lint
73+
74+
test:
75+
needs: prep
76+
runs-on: ubuntu-latest
77+
78+
steps:
79+
- name: Checkout
80+
uses: actions/checkout@v4
81+
82+
- name: Use Node.js ${{ env.NODE }}
83+
uses: actions/setup-node@v4
84+
with:
85+
node-version-file: '.nvmrc'
86+
87+
- name: Cache node_modules
88+
uses: actions/cache@v4
89+
id: cache-node-modules
90+
with:
91+
path: node_modules
92+
key: ${{ runner.os }}-build-${{ hashFiles('**/package.json') }}
93+
94+
- name: Install
95+
run: npm install
96+
97+
- name: Test
98+
run: npm run test
99+
100+
build:
101+
needs: prep
102+
runs-on: ubuntu-latest
103+
104+
steps:
105+
- name: Checkout
106+
uses: actions/checkout@v4
107+
108+
- name: Use Node.js ${{ env.NODE }}
109+
uses: actions/setup-node@v4
110+
with:
111+
node-version-file: '.nvmrc'
112+
113+
- name: Cache node_modules
114+
uses: actions/cache@v4
115+
id: cache-node-modules
116+
with:
117+
path: node_modules
118+
key: ${{ runner.os }}-build-${{ hashFiles('**/package.json') }}
119+
120+
- name: Install
121+
run: npm install
122+
123+
- name: Test
124+
run: npm run all:build

Diff for: package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"client:stage": "lerna run stage --scope='@stac-manager/client'",
1414
"all:build": "lerna run build",
1515
"all:clean": "lerna run clean",
16-
"test": "jest"
16+
"test": "jest",
17+
"lint": "lerna run lint"
1718
},
1819
"devDependencies": {
1920
"@eslint/js": "^9.13.0",

Diff for: packages/client/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
"build": "npm run clean && NODE_ENV=production node tasks/build.mjs",
2222
"stage": "npm run clean && NODE_ENV=staging node tasks/build.mjs",
2323
"clean": "rm -rf dist .parcel-cache",
24-
"lint": "yarn lint:scripts",
25-
"lint:scripts": "eslint app/",
24+
"lint": "eslint src/",
2625
"ts-check": "yarn tsc --noEmit --skipLibCheck",
2726
"test": "jest"
2827
},

Diff for: packages/client/src/pages/CollectionDetail/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ import {
2424
PopoverArrow,
2525
PopoverBody,
2626
PopoverContent,
27-
ButtonGroup
27+
ButtonGroup,
28+
Button
2829
} from '@chakra-ui/react';
2930
import { useCollection, useStacSearch } from '@developmentseed/stac-react';
3031
import {

0 commit comments

Comments
 (0)