diff --git a/.forgejo/FUNDING.yml b/.forgejo/FUNDING.yml new file mode 100644 index 000000000..5c50c3f69 --- /dev/null +++ b/.forgejo/FUNDING.yml @@ -0,0 +1,4 @@ +# These are supported funding model platforms + +github: [ssddanbrown] +ko_fi: ssddanbrown diff --git a/.github/workflows/analyse-php.yml b/.forgejo/workflows/analyse-php.yml similarity index 64% rename from .github/workflows/analyse-php.yml rename to .forgejo/workflows/analyse-php.yml index 647835aeb..1214c39fb 100644 --- a/.github/workflows/analyse-php.yml +++ b/.forgejo/workflows/analyse-php.yml @@ -1,6 +1,7 @@ name: analyse-php on: + workflow_dispatch: push: paths: - '**.php' @@ -11,14 +12,16 @@ on: jobs: build: if: ${{ github.ref != 'refs/heads/l10n_development' }} - runs-on: ubuntu-24.04 + runs-on: docker + container: + image: node:24-bullseye steps: - - uses: actions/checkout@v4 + - uses: https://code.forgejo.org/actions/checkout@v6 - name: Setup PHP - uses: shivammathur/setup-php@v2 + uses: https://github.com/shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: 8.5 extensions: gd, mbstring, json, curl, xml, mysql, ldap - name: Get Composer Cache Directory @@ -27,14 +30,16 @@ jobs: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache composer packages - uses: actions/cache@v4 + uses: https://code.forgejo.org/actions/cache@v5 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-8.3 + key: ${{ runner.os }}-composer-8.5 restore-keys: ${{ runner.os }}-composer- - name: Install composer dependencies run: composer install --prefer-dist --no-interaction --ansi + env: + COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GH_TOKEN }}"}}' - name: Run static analysis check run: composer check-static diff --git a/.github/workflows/lint-js.yml b/.forgejo/workflows/lint-js.yml similarity index 69% rename from .github/workflows/lint-js.yml rename to .forgejo/workflows/lint-js.yml index 9aceea2a2..cef1d0540 100644 --- a/.github/workflows/lint-js.yml +++ b/.forgejo/workflows/lint-js.yml @@ -1,6 +1,7 @@ name: lint-js on: + workflow_dispatch: push: paths: - '**.js' @@ -13,9 +14,11 @@ on: jobs: build: if: ${{ github.ref != 'refs/heads/l10n_development' }} - runs-on: ubuntu-24.04 + runs-on: docker + container: + image: node:24-bullseye steps: - - uses: actions/checkout@v4 + - uses: https://code.forgejo.org/actions/checkout@v6 - name: Install NPM deps run: npm ci diff --git a/.github/workflows/lint-php.yml b/.forgejo/workflows/lint-php.yml similarity index 57% rename from .github/workflows/lint-php.yml rename to .forgejo/workflows/lint-php.yml index cb9dedcb2..abebcc5ec 100644 --- a/.github/workflows/lint-php.yml +++ b/.forgejo/workflows/lint-php.yml @@ -1,6 +1,7 @@ name: lint-php on: + workflow_dispatch: push: paths: - '**.php' @@ -11,14 +12,16 @@ on: jobs: build: if: ${{ github.ref != 'refs/heads/l10n_development' }} - runs-on: ubuntu-24.04 + runs-on: docker + container: + image: node:24-bullseye steps: - - uses: actions/checkout@v4 + - uses: https://code.forgejo.org/actions/checkout@v6 - name: Setup PHP - uses: shivammathur/setup-php@v2 + uses: https://github.com/shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: 8.5 tools: phpcs - name: Run formatting check diff --git a/.github/workflows/test-js.yml b/.forgejo/workflows/test-js.yml similarity index 74% rename from .github/workflows/test-js.yml rename to .forgejo/workflows/test-js.yml index 379f1ebfa..6fa21ee27 100644 --- a/.github/workflows/test-js.yml +++ b/.forgejo/workflows/test-js.yml @@ -1,6 +1,7 @@ name: test-js on: + workflow_dispatch: push: paths: - '**.js' @@ -15,9 +16,11 @@ on: jobs: build: if: ${{ github.ref != 'refs/heads/l10n_development' }} - runs-on: ubuntu-24.04 + runs-on: docker + container: + image: node:24-bullseye steps: - - uses: actions/checkout@v6 + - uses: https://code.forgejo.org/actions/checkout@v6 - name: Install NPM deps run: npm ci diff --git a/.github/workflows/test-migrations.yml b/.forgejo/workflows/test-migrations.yml similarity index 65% rename from .github/workflows/test-migrations.yml rename to .forgejo/workflows/test-migrations.yml index 80075c3f7..7348ff2b3 100644 --- a/.github/workflows/test-migrations.yml +++ b/.forgejo/workflows/test-migrations.yml @@ -1,6 +1,7 @@ name: test-migrations on: + workflow_dispatch: push: paths: - '**.php' @@ -13,15 +14,25 @@ on: jobs: build: if: ${{ github.ref != 'refs/heads/l10n_development' }} - runs-on: ubuntu-24.04 + runs-on: docker + container: + image: node:24-bullseye strategy: matrix: php: ['8.2', '8.3', '8.4', '8.5'] + services: + mysql: + image: docker.io/library/mariadb:12.2.2-noble + env: + MARIADB_USER: bookstack-test + MARIADB_PASSWORD: bookstack-test + MARIADB_DATABASE: bookstack-test + MARIADB_ROOT_PASSWORD: password steps: - - uses: actions/checkout@v4 + - uses: https://code.forgejo.org/actions/checkout@v6 - name: Setup PHP - uses: shivammathur/setup-php@v2 + uses: https://github.com/shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} extensions: gd, mbstring, json, curl, xml, mysql, ldap @@ -32,34 +43,31 @@ jobs: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache composer packages - uses: actions/cache@v4 + uses: https://code.forgejo.org/actions/cache@v5 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ matrix.php }} restore-keys: ${{ runner.os }}-composer- - - name: Start MySQL - run: | - sudo systemctl start mysql - - - name: Create database & user - run: | - mysql -uroot -proot -e 'CREATE DATABASE IF NOT EXISTS `bookstack-test`;' - mysql -uroot -proot -e "CREATE USER 'bookstack-test'@'localhost' IDENTIFIED WITH mysql_native_password BY 'bookstack-test';" - mysql -uroot -proot -e "GRANT ALL ON \`bookstack-test\`.* TO 'bookstack-test'@'localhost';" - mysql -uroot -proot -e 'FLUSH PRIVILEGES;' - - name: Install composer dependencies run: composer install --prefer-dist --no-interaction --ansi + env: + COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GH_TOKEN }}"}}' - name: Start migration test + env: + DB_HOST: mysql run: | php${{ matrix.php }} artisan migrate --force -n --database=mysql_testing - name: Start migration:rollback test + env: + DB_HOST: mysql run: | php${{ matrix.php }} artisan migrate:rollback --force -n --database=mysql_testing - name: Start migration rerun test + env: + DB_HOST: mysql run: | php${{ matrix.php }} artisan migrate --force -n --database=mysql_testing diff --git a/.github/workflows/test-php.yml b/.forgejo/workflows/test-php.yml similarity index 64% rename from .github/workflows/test-php.yml rename to .forgejo/workflows/test-php.yml index 5f4c16caf..0fc39d9fa 100644 --- a/.github/workflows/test-php.yml +++ b/.forgejo/workflows/test-php.yml @@ -1,6 +1,7 @@ name: test-php on: + workflow_dispatch: push: paths: - '**.php' @@ -13,15 +14,25 @@ on: jobs: build: if: ${{ github.ref != 'refs/heads/l10n_development' }} - runs-on: ubuntu-24.04 + runs-on: docker + container: + image: node:24-bullseye strategy: matrix: php: ['8.2', '8.3', '8.4', '8.5'] + services: + mysql: + image: docker.io/library/mariadb:12.2.2-noble + env: + MARIADB_USER: bookstack-test + MARIADB_PASSWORD: bookstack-test + MARIADB_DATABASE: bookstack-test + MARIADB_ROOT_PASSWORD: password steps: - - uses: actions/checkout@v4 + - uses: https://code.forgejo.org/actions/checkout@v6 - name: Setup PHP - uses: shivammathur/setup-php@v2 + uses: https://github.com/shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} extensions: gd, mbstring, json, curl, xml, mysql, ldap, gmp @@ -32,30 +43,25 @@ jobs: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache composer packages - uses: actions/cache@v4 + uses: https://code.forgejo.org/actions/cache@v5 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ matrix.php }} restore-keys: ${{ runner.os }}-composer- - - name: Start Database - run: | - sudo systemctl start mysql - - - name: Setup Database - run: | - mysql -uroot -proot -e 'CREATE DATABASE IF NOT EXISTS `bookstack-test`;' - mysql -uroot -proot -e "CREATE USER 'bookstack-test'@'localhost' IDENTIFIED WITH mysql_native_password BY 'bookstack-test';" - mysql -uroot -proot -e "GRANT ALL ON \`bookstack-test\`.* TO 'bookstack-test'@'localhost';" - mysql -uroot -proot -e 'FLUSH PRIVILEGES;' - - name: Install composer dependencies run: composer install --prefer-dist --no-interaction --ansi + env: + COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GH_TOKEN }}"}}' - name: Migrate and seed the database + env: + DB_HOST: mysql run: | php${{ matrix.php }} artisan migrate --force -n --database=mysql_testing php${{ matrix.php }} artisan db:seed --force -n --class=DummyContentSeeder --database=mysql_testing - name: Run PHP tests + env: + DB_HOST: mysql run: php${{ matrix.php }} ./vendor/bin/phpunit