Skip to content

Commit bbdc5da

Browse files
authored
Merge pull request #1555 from thunderstore-io/tests-and-coverage
Tests and coverage
2 parents 44fadb8 + a8426a5 commit bbdc5da

File tree

131 files changed

+899
-2089
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+899
-2089
lines changed

.github/workflows/test.yml

Lines changed: 73 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
python-version: "3.8"
4040
- uses: actions/setup-node@v4
4141
with:
42-
node-version: "20"
42+
node-version: "24"
4343
- name: Get node version
4444
id: node-version
4545
run: echo "::set-output name=node-version::$(node --version)"
@@ -88,10 +88,10 @@ jobs:
8888
# if: github.event_name != 'pull_request'
8989
# run: IMAGE_TAG=${GITHUB_REF##*/} docker compose -f docker-compose.build.yml push
9090

91-
test:
92-
name: Test
91+
build:
92+
name: Build
9393
runs-on: ubuntu-latest
94-
needs: get-node-version
94+
needs: [get-node-version, pre-commit]
9595
env:
9696
VITE_SITE_URL: ${{ vars.NEXT_PUBLIC_SITE_URL }}
9797
VITE_API_URL: ${{ vars.NEXT_PUBLIC_API_URL }}
@@ -116,53 +116,94 @@ jobs:
116116
run: yarn workspace @thunderstore/cyberstorm build
117117
- name: Build @thunderstore/cyberstorm-forms
118118
run: yarn workspace @thunderstore/cyberstorm-forms build
119-
- name: Build and test @thunderstore/cyberstorm-remix
120-
run: |
121-
yarn workspace @thunderstore/cyberstorm-remix build
122-
yarn workspace @thunderstore/cyberstorm-remix test run
123-
# Enable once build process has been fixed.
124-
# - name: Build @thunderstore/cyberstorm-storybook
125-
# run: yarn workspace @thunderstore/cyberstorm-storybook build
119+
- name: Build @thunderstore/cyberstorm-remix
120+
run: yarn workspace @thunderstore/cyberstorm-remix build
121+
- name: Build @thunderstore/storybook
122+
run: yarn workspace @thunderstore/storybook build
126123
- name: Build @thunderstore/dapper
127124
run: yarn workspace @thunderstore/dapper build
128125
- name: Build @thunderstore/dapper-fake
129126
run: yarn workspace @thunderstore/dapper-fake build
130-
- name: Build and test @thunderstore/dapper-ts
131-
run: |
132-
yarn workspace @thunderstore/dapper-ts build
133-
yarn workspace @thunderstore/dapper-ts test
134-
- name: Build and test @thunderstore/graph-system
135-
run: |
136-
yarn workspace @thunderstore/graph-system build
137-
yarn workspace @thunderstore/graph-system test run
127+
- name: Build @thunderstore/dapper-ts
128+
run: yarn workspace @thunderstore/dapper-ts build
129+
- name: Build @thunderstore/graph-system
130+
run: yarn workspace @thunderstore/graph-system build
138131
- name: Build @thunderstore/react-dnd
139132
run: yarn workspace @thunderstore/react-dnd build
140-
- name: Build and test @thunderstore/thunderstore-api
141-
run: |
142-
yarn workspace @thunderstore/thunderstore-api build
143-
yarn workspace @thunderstore/thunderstore-api test
133+
- name: Build @thunderstore/thunderstore-api
134+
run: yarn workspace @thunderstore/thunderstore-api build
144135
- name: Build @thunderstore/ts-api-react
145136
run: yarn workspace @thunderstore/ts-api-react build
146137
- name: Build @thunderstore/ts-api-react-actions
147138
run: yarn workspace @thunderstore/ts-api-react-actions build
148139
- name: Build @thunderstore/ts-api-react-forms
149140
run: yarn workspace @thunderstore/ts-api-react-forms build
150-
- name: Build and test @thunderstore/ts-uploader
151-
# Add running tests once they've been fixed.
152-
run: |
153-
yarn workspace @thunderstore/ts-uploader build
141+
- name: Build @thunderstore/ts-uploader
142+
run: yarn workspace @thunderstore/ts-uploader build
154143
- name: Build @thunderstore/ts-uploader-react
155144
run: yarn workspace @thunderstore/ts-uploader-react build
156-
- name: Build and test @thunderstore/typed-event-emitter
157-
run: |
158-
yarn workspace @thunderstore/typed-event-emitter build
159-
yarn workspace @thunderstore/typed-event-emitter test
145+
- name: Build @thunderstore/typed-event-emitter
146+
run: yarn workspace @thunderstore/typed-event-emitter build
160147
- name: Build @thunderstore/use-promise
161148
run: yarn workspace @thunderstore/use-promise build
162149

150+
test:
151+
name: Test
152+
runs-on: ubuntu-latest
153+
needs: [get-node-version, pre-commit, build]
154+
env:
155+
VITE_SITE_URL: ${{ vars.NEXT_PUBLIC_SITE_URL }}
156+
VITE_API_URL: ${{ vars.NEXT_PUBLIC_API_URL }}
157+
VITE_AUTH_BASE_URL: ${{ vars.NEXT_PUBLIC_SITE_URL }}
158+
VITE_AUTH_RETURN_URL: ${{ vars.NEXT_PUBLIC_SITE_URL }}
159+
steps:
160+
- name: "Checkout"
161+
uses: actions/checkout@v4
162+
- name: "Setup Python 3.10"
163+
id: setup-python
164+
uses: actions/setup-python@v5
165+
with:
166+
python-version: "3.10"
167+
- name: Set up Node 24
168+
uses: actions/setup-node@v4
169+
with:
170+
node-version: "24"
171+
cache: "yarn"
172+
- name: Set fontawesome token
173+
run: |
174+
npm config set "@fortawesome:registry" https://npm.fontawesome.com/
175+
npm config set "//npm.fontawesome.com/:_authToken" ${{ secrets.NPM_FA_TOKEN }}
176+
- uses: snok/install-poetry@v1
177+
with:
178+
version: 1.4.1
179+
virtualenvs-create: true
180+
virtualenvs-in-project: true
181+
- name: Cache poetry venv
182+
id: cache-poetry
183+
uses: actions/cache@v4
184+
with:
185+
path: tools/test-ci/.venv
186+
key: "poetry-${{ runner.os }}-\
187+
${{ steps.setup-python.outputs.python-version }}-\
188+
${{ hashFiles('tools/test-ci/poetry.lock') }}"
189+
restore-keys: |
190+
poetry-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-
191+
- name: Install poetry dependencies
192+
run: |
193+
cd tools/test-ci/
194+
poetry install
195+
- name: Run testing script
196+
run: |
197+
cd tools/test-ci/
198+
poetry run python run_ci_script.py
199+
- name: Upload results to Codecov
200+
uses: codecov/codecov-action@v5
201+
with:
202+
token: ${{ secrets.CODECOV_TOKEN }}
203+
163204
chromatic-deployment:
164205
runs-on: ubuntu-latest
165-
needs: ["test", "pre-commit", "get-node-version"]
206+
needs: [get-node-version, pre-commit, build, test]
166207
strategy:
167208
matrix:
168209
projects: [

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
**/yarn-error.log
44
.npmrc
55
/.env.development
6+
/coverage

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Thunderstore UI
22

3+
[![codecov](https://codecov.io/gh/thunderstore-io/thunderstore-ui/branch/master/graph/badge.svg)](https://codecov.io/gh/thunderstore-io/thunderstore-ui)
4+
35
Monorepo containing Remix frontend for [thunderstore.io](https://thunderstore.io)
46
and reusable UI components.
57

apps/cyberstorm-remix/app/c/community.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { faBook, faDownload } from "@fortawesome/free-solid-svg-icons";
2222
import { faDiscord } from "@fortawesome/free-brands-svg-icons";
2323
import { faArrowUpRight } from "@fortawesome/pro-solid-svg-icons";
2424
import { DapperTs } from "@thunderstore/dapper-ts";
25-
import { OutletContextShape } from "../root";
25+
import { type OutletContextShape } from "../root";
2626
import {
2727
getPublicEnvVariables,
2828
getSessionTools,

apps/cyberstorm-remix/app/c/tabs/PackageSearch/PackageSearch.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import {
66
getPublicEnvVariables,
77
getSessionTools,
88
} from "cyberstorm/security/publicEnvVariables";
9-
import { OutletContextShape } from "~/root";
10-
import { Route } from "./+types/PackageSearch";
9+
import { type OutletContextShape } from "~/root";
10+
import type { Route } from "./+types/PackageSearch";
1111

1212
export async function loader({ params, request }: Route.LoaderArgs) {
1313
if (params.communityId) {

apps/cyberstorm-remix/app/commonComponents/Markdown/Sanitize.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Schema, sanitize } from "hast-util-sanitize";
2-
import { type Nodes } from "hast";
1+
import { type Schema, sanitize } from "hast-util-sanitize";
2+
import type { Nodes } from "hast";
33

44
/**
55
* Based on:

apps/cyberstorm-remix/app/p/dependants/Dependants.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import "./Dependants.css";
88
import { PackageSearch } from "~/commonComponents/PackageSearch/PackageSearch";
99
import { DapperTs } from "@thunderstore/dapper-ts";
1010
import { PackageOrderOptions } from "../../commonComponents/PackageSearch/components/PackageOrder";
11-
import { OutletContextShape } from "../../root";
11+
import { type OutletContextShape } from "../../root";
1212
import { PageHeader } from "~/commonComponents/PageHeader/PageHeader";
1313
import {
1414
getPublicEnvVariables,
1515
getSessionTools,
1616
} from "cyberstorm/security/publicEnvVariables";
17-
import { Route } from "./+types/Dependants";
17+
import type { Route } from "./+types/Dependants";
1818
import { Suspense } from "react";
1919

2020
export async function loader({ params, request }: Route.LoaderArgs) {

apps/cyberstorm-remix/app/p/packageEdit.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
} from "@thunderstore/thunderstore-api";
1818
import { formatToDisplayName } from "@thunderstore/cyberstorm/src/utils/utils";
1919
import { DapperTs } from "@thunderstore/dapper-ts";
20-
import { OutletContextShape } from "~/root";
20+
import { type OutletContextShape } from "~/root";
2121
import {
2222
getPublicEnvVariables,
2323
getSessionTools,

apps/cyberstorm-remix/app/p/packageListing.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ import {
7272
formatToDisplayName,
7373
} from "@thunderstore/cyberstorm/src/utils/utils";
7474
import { DapperTs } from "@thunderstore/dapper-ts";
75-
import { OutletContextShape } from "~/root";
75+
import { type OutletContextShape } from "~/root";
7676
import { CopyButton } from "~/commonComponents/CopyButton/CopyButton";
7777
import {
7878
getPublicEnvVariables,

apps/cyberstorm-remix/app/p/tabs/Required/Required.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Await, LoaderFunctionArgs } from "react-router";
44
import { useLoaderData, useOutletContext } from "react-router";
55
import { ListingDependency } from "~/commonComponents/ListingDependency/ListingDependency";
66
import { DapperTs } from "@thunderstore/dapper-ts";
7-
import { OutletContextShape } from "~/root";
7+
import { type OutletContextShape } from "~/root";
88
import {
99
getPublicEnvVariables,
1010
getSessionTools,

0 commit comments

Comments
 (0)