Skip to content

Commit

Permalink
Updated workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
VampireAotD committed Apr 23, 2024
1 parent abdad2f commit ca6171e
Show file tree
Hide file tree
Showing 12 changed files with 1,251 additions and 866 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Backend build
name: Backend tests

on: [ push, pull_request ]

jobs:
build:
tests:
runs-on: ubuntu-latest

defaults:
Expand All @@ -30,7 +30,7 @@ jobs:
- uses: actions/checkout@v4

- name: Cache Composer dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: src/vendor
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
Expand All @@ -45,13 +45,7 @@ jobs:
- name: Install Composer dependencies
run: composer install -qn --no-ansi --no-progress --no-scripts --prefer-dist

- name: Run Psalm
run: ./vendor/bin/psalm -c psalm.xml

- name: Run PHPStan
run: ./vendor/bin/phpstan analyze --memory-limit=2G

- name: Run tests
env:
DB_HOST: 127.0.0.1
run: php artisan test --coverage
run: php artisan test --coverage
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Frontend build
name: Frontend tests

on: [ push, pull_request ]

jobs:
build:
tests:
runs-on: ubuntu-latest

defaults:
Expand All @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Frontend lint

on: [ push, pull_request ]

jobs:
lint:
runs-on: ubuntu-latest

defaults:
run:
working-directory: src

strategy:
matrix:
node-version: [ 20.x ]

steps:
- uses: actions/checkout@v4

- name: Install Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
cache-dependency-path: ./src/yarn.lock

- name: Install dependencies
run: |
yarn set version berry
yarn config set -H enableTelemetry false
yarn install --immutable
- name: Run ESLint
run: yarn lint

- name: Run Prettier
run: yarn prettier-check
2 changes: 1 addition & 1 deletion .github/workflows/scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: ShellCheck
on: [ push, pull_request ]

jobs:
build:
check:
runs-on: ubuntu-latest

steps:
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Backend static analysis

on: [ push, pull_request ]

jobs:
analysis:
runs-on: ubuntu-latest

defaults:
run:
working-directory: src

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: src/vendor
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'

- name: Install Composer dependencies
run: composer install

- name: Run Psalm
run: ./vendor/bin/psalm -c psalm.xml

- name: Run PHPStan
run: ./vendor/bin/phpstan analyze --memory-limit=2G
24 changes: 12 additions & 12 deletions src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,37 @@
"devDependencies": {
"@inertiajs/vue3": "^1.0",
"@tailwindcss/forms": "^0.5",
"@typescript-eslint/eslint-plugin": "^7.1",
"@typescript-eslint/parser": "^7.1",
"@typescript-eslint/eslint-plugin": "^7.7",
"@typescript-eslint/parser": "^7.7",
"@vitejs/plugin-vue": "^5.0",
"@vue/eslint-config-prettier": "^9.0",
"@vue/eslint-config-typescript": "^12.0",
"@vue/eslint-config-typescript": "^13.0",
"@vue/test-utils": "^2.4",
"autoprefixer": "^10.4",
"axios": "^1.6",
"eslint": "^8.56",
"eslint": "^8.57",
"eslint-config-prettier": "^9.1",
"eslint-plugin-prettier": "^5.1",
"eslint-plugin-vue": "^9.19",
"happy-dom": "^13.6",
"eslint-plugin-vue": "^9.25",
"happy-dom": "^14.7",
"laravel-echo": "^1.16",
"laravel-vite-plugin": "^1.0",
"postcss": "^8.4",
"prettier": "^3.2",
"pusher-js": "^8.4.0-rc2",
"tailwindcss": "^3.4",
"typescript": "^5.3",
"vite": "^5.1",
"vitest": "^1.3",
"typescript": "^5.4.5",
"vite": "^5.2",
"vitest": "^1.5",
"vue": "^3.4",
"vue-eslint-parser": "^9.4",
"vue-tsc": "^1.8",
"ziggy-js": "^2.0"
"vue-tsc": "^2.0.14",
"ziggy-js": "^2.1"
},
"dependencies": {
"@vueuse/core": "^10.9",
"chart.js": "^4.4.1",
"primeicons": "^6.0.1",
"primeicons": "^7.0.0",
"primevue": "^3.49"
}
}
1 change: 0 additions & 1 deletion src/resources/js/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import PrimeVue from 'primevue/config';
import Tailwind from 'primevue/passthrough/tailwind';
import ToastService from 'primevue/toastservice';
import Toast from 'primevue/toast';
// @ts-expect-error Declaration of ZiggyVue
import { ZiggyVue } from 'ziggy-js';

const appName = import.meta.env.VITE_APP_NAME || 'Anilibrary';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const addUrl = () => form.urls.push({ url: '' });
const removeUrl = (index: number) => form.urls.splice(index, 1);
const addSynonym = () => form.synonyms.push({ synonym: '' });
const addSynonym = () => form.synonyms.push({ name: '' });
const removeSynonym = (index: number) => form.synonyms.splice(index, 1);
Expand Down Expand Up @@ -213,7 +213,7 @@ const createAnime = () => {};
class="flex gap-2"
>
<TextInput
v-model="synonym.synonym"
v-model="synonym.name"
name="synonym[]"
class="w-9/12 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
placeholder="Anime synonym"
Expand Down
13 changes: 1 addition & 12 deletions src/resources/js/features/anime/rating/AnimeRating.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
<script setup lang="ts">
import Rating from 'primevue/rating';
import { computed } from 'vue';
type Props = {
modelValue: number;
};
const props = defineProps<Props>();
const emit = defineEmits<{ 'update:modelValue': [value: number] }>();
const rating = computed({
get: () => props.modelValue,
set: (value: number) => emit('update:modelValue', value),
});
const rating = defineModel<number>();
</script>

<template>
Expand Down
2 changes: 1 addition & 1 deletion src/resources/js/pages/Anime/Show.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const props = defineProps<{ anime: Models.Anime }>();
const rating = computed(() => props.anime.rating);
const links = computed(() => props.anime.urls.map((link) => link.url));
const synonyms = computed(() => props.anime.synonyms.map((synonym) => synonym.synonym));
const synonyms = computed(() => props.anime.synonyms.map((synonym) => synonym.name));
const genres = computed((): string =>
props.anime.genres.map((genre) => genre.name).join(', ')
);
Expand Down
10 changes: 2 additions & 8 deletions src/resources/js/shared/ui/input/text/TextInput.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
<script setup lang="ts">
import { onMounted, ref } from 'vue';
type Props = {
modelValue: string;
};
defineProps<Props>();
defineEmits<{ 'update:modelValue': [value: string] }>();
defineExpose({ focus: () => input.value?.focus() });
const model = defineModel<string>();
const input = ref<HTMLInputElement | null>(null);
onMounted(() => {
Expand All @@ -21,8 +16,7 @@ onMounted(() => {
<template>
<input
ref="input"
v-model="model"
class="text-black border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm"
:value="modelValue"
@input="$emit('update:modelValue', ($event.target as HTMLInputElement).value)"
/>
</template>
Loading

0 comments on commit ca6171e

Please sign in to comment.