Skip to content

Commit

Permalink
Add GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Geometrically committed Jul 4, 2024
1 parent 0d8de2e commit ae63369
Show file tree
Hide file tree
Showing 99 changed files with 1,250 additions and 3,885 deletions.
45 changes: 25 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
name: CI

on:
push:
branches:
- main
- master
pull_request:

permissions:
actions: read
contents: read

jobs:
main:
master:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -20,21 +15,31 @@ jobs:

- uses: pnpm/action-setup@v2
with:
version: 8
version: 9

# Connect your workspace on nx.app and uncomment this to enable task distribution.
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested
# - run: pnpm dlx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"

# Cache node_modules
- uses: actions/setup-node@v3
- name: Restore cached npm dependencies
id: cache-dependencies-restore
uses: actions/cache/restore@v3
with:
node-version: 20
cache: 'pnpm'
path: |
node_modules
key: npm-dependencies-${{ hashFiles('pnpm-lock.yaml') }}

- run: pnpm install --frozen-lockfile
- uses: nrwl/nx-set-shas@v4

# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
# - run: pnpm exec nx-cloud record -- echo Hello World
- run: pnpm exec nx affected -t lint test build
- name: Cache npm dependencies
id: cache-dependencies-save
uses: actions/cache/save@v3
with:
path: |
node_modules
key: ${{ steps.cache-dependencies-restore.outputs.cache-primary-key }}

- uses: nrwl/nx-set-shas@v3

# This line is needed for nx affected to work when CI is running on a PR
- run: git branch --track master origin/master
if: ${{ github.event_name == 'pull_request' }}

- run: pnpm nx affected -t lint test build --parallel=3
- run: pnpm nx affected -t e2e --parallel=1
18 changes: 0 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions apps/knossos/src/components/ui/Avatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
:alt="alt"
:loading="loading"
@load="updatePixelated"
>
/>
<svg
v-else
:class="`avatar size-${size} ${circle ? 'circle' : ''} ${noShadow ? 'no-shadow' : ''} ${
Expand All @@ -24,10 +24,7 @@
viewBox="0 0 104 104"
aria-hidden="true"
>
<path
fill="none"
d="M0 0h103.4v103.4H0z"
/>
<path fill="none" d="M0 0h103.4v103.4H0z" />
<path
fill="none"
stroke="#9a9a9a"
Expand Down
5 changes: 1 addition & 4 deletions apps/knossos/src/components/ui/Breadcrumbs.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<template>
<nav class="breadcrumbs">
<template
v-for="(link, index) in linkStack"
:key="index"
>
<template v-for="(link, index) in linkStack" :key="index">
<NuxtLink
:to="link.href"
class="breadcrumb goto-link"
Expand Down
15 changes: 3 additions & 12 deletions apps/knossos/src/components/ui/Checkbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,11 @@
:aria-label="description ?? label"
:aria-checked="modelValue"
>
<CheckIcon
v-if="modelValue && !collapsingToggleStyle"
aria-hidden="true"
/>
<DropdownIcon
v-else-if="collapsingToggleStyle"
aria-hidden="true"
/>
<CheckIcon v-if="modelValue && !collapsingToggleStyle" aria-hidden="true" />
<DropdownIcon v-else-if="collapsingToggleStyle" aria-hidden="true" />
</button>
<!-- aria-hidden is set so screenreaders only use the <button>'s aria-label -->
<p
v-if="label"
aria-hidden="true"
>
<p v-if="label" aria-hidden="true">
{{ label }}
</p>
<slot v-else />
Expand Down
18 changes: 4 additions & 14 deletions apps/knossos/src/components/ui/CollectionCreateModal.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<Modal
ref="modal"
header="Create a collection"
>
<Modal ref="modal" header="Create a collection">
<div class="universal-modal modal-creation universal-labels">
<div class="markdown-body">
<p>
Expand All @@ -21,27 +18,20 @@
maxlength="64"
:placeholder="`Enter collection name...`"
autocomplete="off"
>
/>
<label for="additional-information">
<span class="label__title">Summary<span class="required">*</span></span>
<span class="label__description">This appears on your collection's page.</span>
</label>
<div class="textarea-wrapper">
<textarea
id="additional-information"
v-model="description"
maxlength="256"
/>
<textarea id="additional-information" v-model="description" maxlength="256" />
</div>
<div class="push-right input-group">
<Button @click="modal.hide()">
<CrossIcon />
Cancel
</Button>
<Button
color="primary"
@click="create"
>
<Button color="primary" @click="create">
<CheckIcon />
Continue
</Button>
Expand Down
5 changes: 1 addition & 4 deletions apps/knossos/src/components/ui/ConditionalNuxtLink.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<nuxt-link
v-if="isLink"
:to="to"
>
<nuxt-link v-if="isLink" :to="to">
<slot />
</nuxt-link>
<span v-else>
Expand Down
7 changes: 1 addition & 6 deletions apps/knossos/src/components/ui/CopyCode.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<template>
<button
class="code"
:class="{ copied }"
title="Copy code to clipboard"
@click="copyText"
>
<button class="code" :class="{ copied }" title="Copy code to clipboard" @click="copyText">
<span>{{ text }}</span>
<CheckIcon v-if="copied" />
<ClipboardCopyIcon v-else />
Expand Down
13 changes: 5 additions & 8 deletions apps/knossos/src/components/ui/EnvironmentIndicator.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
<template>
<span
v-if="typeOnly"
class="environment"
>
<span v-if="typeOnly" class="environment">
<InfoIcon aria-hidden="true" />
A {{ type }}
</span>
<span
v-else-if="
!['resourcepack', 'shader'].includes(type) &&
!(type === 'plugin' && search) &&
!categories.some((x) => tags.loaderData.dataPackLoaders.includes(x))
!(type === 'plugin' && search) &&
!categories.some((x) => tags.loaderData.dataPackLoaders.includes(x))
"
class="environment"
>
Expand All @@ -25,7 +22,7 @@
<template
v-else-if="
(clientSide === 'optional' || clientSide === 'required') &&
(serverSide === 'optional' || serverSide === 'unsupported')
(serverSide === 'optional' || serverSide === 'unsupported')
"
>
<ClientIcon aria-hidden="true" />
Expand All @@ -34,7 +31,7 @@
<template
v-else-if="
(serverSide === 'optional' || serverSide === 'required') &&
(clientSide === 'optional' || clientSide === 'unsupported')
(clientSide === 'optional' || clientSide === 'unsupported')
"
>
<ServerIcon aria-hidden="true" />
Expand Down
2 changes: 1 addition & 1 deletion apps/knossos/src/components/ui/FileInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
:accept="accept"
:disabled="disabled"
@change="handleChange"
>
/>
</label>
</template>

Expand Down
6 changes: 1 addition & 5 deletions apps/knossos/src/components/ui/MessageBanner.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<template>
<div class="message-banner">
<div
class="message-banner__content"
:class="cardClassByType"
:aria-label="ariaLabelByType"
>
<div class="message-banner__content" :class="cardClassByType" :aria-label="ariaLabelByType">
<slot />
</div>
</div>
Expand Down
15 changes: 3 additions & 12 deletions apps/knossos/src/components/ui/Modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,11 @@
class="modal-overlay"
@click="hide"
/>
<div
class="modal-container"
:class="{ shown: actuallyShown }"
>
<div class="modal-container" :class="{ shown: actuallyShown }">
<div class="modal-body">
<div
v-if="header"
class="header"
>
<div v-if="header" class="header">
<strong>{{ header }}</strong>
<button
class="iconified-button icon-only transparent"
@click="hide"
>
<button class="iconified-button icon-only transparent" @click="hide">
<CrossIcon />
</button>
</div>
Expand Down
29 changes: 6 additions & 23 deletions apps/knossos/src/components/ui/ModalConfirm.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
<template>
<Modal
ref="modal"
:header="title"
>
<Modal ref="modal" :header="title">
<div class="modal-delete">
<div
class="markdown-body"
v-html="renderString(description)"
/>
<label
v-if="hasToType"
for="confirmation"
class="confirmation-label"
>
<div class="markdown-body" v-html="renderString(description)" />
<label v-if="hasToType" for="confirmation" class="confirmation-label">
<span>
<strong>To verify, type</strong>
<em class="confirmation-text">{{ confirmationText }}</em>
Expand All @@ -27,21 +17,14 @@
type="text"
placeholder="Type here..."
@input="type"
>
/>
</div>
<div class="button-group">
<button
class="iconified-button"
@click="cancel"
>
<button class="iconified-button" @click="cancel">
<CrossIcon />
Cancel
</button>
<button
class="iconified-button danger-button"
:disabled="action_disabled"
@click="proceed"
>
<button class="iconified-button danger-button" :disabled="action_disabled" @click="proceed">
<TrashIcon />
{{ proceedLabel }}
</button>
Expand Down
Loading

0 comments on commit ae63369

Please sign in to comment.