diff options
author | Vitor Mattos <vitor@php.rio> | 2023-03-02 13:04:43 -0300 |
---|---|---|
committer | Vitor Mattos <vitor@php.rio> | 2023-03-02 22:00:33 -0300 |
commit | 8ca055cc683400635e8825c1e334d19480279905 (patch) | |
tree | d163d9350a2dc77e549ca1a1c9f514b62e012524 /.github | |
parent | 2e15b55e3e8d29374fd96936b5bb593a5ef1304d (diff) |
* Convert arguments and options to table format
* Add the markdown occ to mkdocs
* Add GitHub Action to check if the documentation is up to date
Signed-off-by: Vitor Mattos <vitor@php.rio>
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/occ-command-documentation.yml | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/.github/workflows/occ-command-documentation.yml b/.github/workflows/occ-command-documentation.yml new file mode 100644 index 000000000..9f439a25a --- /dev/null +++ b/.github/workflows/occ-command-documentation.yml @@ -0,0 +1,91 @@ +name: Occ command documentation + +on: + pull_request: + paths: + - '.github/workflows/**' + - 'appinfo/**' + - 'lib/**' + - 'templates/**' + - 'tests/**' + - 'vendor/**' + - 'vendor-bin/**' + - '.php-cs-fixer.dist.php' + - 'composer.json' + - 'composer.lock' + + push: + branches: + - main + - master + - stable* + +permissions: + contents: read + +concurrency: + group: occ-command-documentation-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + occ-command-documentation: + runs-on: ubuntu-latest + + strategy: + matrix: + php-versions: ['8.0', '8.1'] + server-versions: ['master'] + + steps: + - name: Set app env + run: | + # Split and keep last + echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV + + - name: Checkout server + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + with: + submodules: true + repository: nextcloud/server + ref: ${{ matrix.server-versions }} + + - name: Checkout app + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + with: + path: apps/${{ env.APP_NAME }} + + - name: Set up php ${{ matrix.php-versions }} + uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite + coverage: none + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Check composer file existence + id: check_composer + uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2 + with: + files: apps/${{ env.APP_NAME }}/composer.json + + - name: Set up dependencies + # Only run if phpunit config file exists + if: steps.check_composer.outputs.files_exists == 'true' + working-directory: apps/${{ env.APP_NAME }} + run: composer i + + - name: Set up Nextcloud + env: + DB_PORT: 4444 + run: | + mkdir data + ./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password + ./occ app:enable --force ${{ env.APP_NAME }} + ./occ config:system:set debug --value true --type boolean + + - name: Check if documentation is up to date + id: check_documentation + run: | + ./occ talk:developer:update-docs + bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Documentation outdated. Run the command talk:developer:update-docs locally, commit the occ.md file and push the changes.' && exit 1)" |