Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mzur authored Apr 2, 2024
0 parents commit 69c06f6
Show file tree
Hide file tree
Showing 25 changed files with 19,910 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"env": {
"browser": true,
"es2020": true
},
"extends": [
"eslint:recommended",
"plugin:vue/essential"
],
"parserOptions": {
"ecmaVersion": 11,
"sourceType": "module"
},
"plugins": [
"vue"
],
"rules": {
"no-prototype-builtins": "off",
"no-console": ["error", {"allow": ["warn", "error"]}],
"vue/require-v-for-key": "off"
},
"globals": {
"biigle": "readonly",
"Vue": "readonly"
}
}
28 changes: 28 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Lint

on:
push:
branches:
- main
pull_request:

jobs:
lint:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Set registry authentication token
run: echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> .npmrc
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Install dependencies
run: npm install

- name: Run ESLint
run: npm run lint
65 changes: 65 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Tests

on:
push:
branches:
- main
pull_request:

jobs:
test-module:

runs-on: ubuntu-latest

env:
MODULE_NAME: Module

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1

- uses: actions/checkout@v1
with:
repository: biigle/core
ref: master
fetch-depth: 1
path: core

- name: Validate composer.json and composer.lock
run: composer validate
working-directory: ../core

- name: Copy .env
run: cp .env.example .env
working-directory: ../core

- name: Set testing key
run: echo "APP_KEY=base64:STZFA4bQKDjE2mlpRPmsJ/okG0eCh4RHd9BghtZeYmQ=" >> .env
working-directory: ../core

- name: Install Dependencies
run: composer install --no-ansi --no-interaction --no-scripts --prefer-dist --ignore-platform-reqs
working-directory: ../core

- name: Install current repository
run: |
composer config repositories.module --json '{"type": "path", "url": "'${GITHUB_WORKSPACE}'", "options": {"symlink": false}}'
composer require --no-ansi --no-interaction --no-scripts --ignore-platform-reqs ${GITHUB_REPOSITORY}:@dev
sed -i "/Insert Biigle module service providers/i Biigle\\\\Modules\\\\${MODULE_NAME}\\\\${MODULE_NAME}ServiceProvider::class," config/app.php
mkdir -p tests/php/Modules
ln -sf ../../../vendor/${GITHUB_REPOSITORY}/tests tests/php/Modules/${MODULE_NAME}
working-directory: ../core

- name: Fetch base images
run: |
docker pull ghcr.io/biigle/app:latest
docker pull ghcr.io/biigle/worker:latest
- name: Start test database
run: docker-compose up -d --no-build database_testing && sleep 5
working-directory: ../core

- name: Run tests
run: docker-compose run --rm -u 1001 worker php -d memory_limit=1G vendor/bin/phpunit --random-order --filter 'Biigle\\Tests\\Modules\\'${MODULE_NAME}
working-directory: ../core
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/vendor
/node_modules
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@mzur:registry=https://npm.pkg.github.com
Loading

0 comments on commit 69c06f6

Please sign in to comment.