-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ocs): add OCS extractor and workflow
Signed-off-by: Anna Larch <[email protected]>
- Loading branch information
1 parent
c53144e
commit e854dc7
Showing
9 changed files
with
458 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# This workflow is provided via the organization template repository | ||
# | ||
# https://github.com/nextcloud/.github | ||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization | ||
# | ||
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
# SPDX-FileCopyrightText: 2024 Arthur Schiwon <[email protected]> | ||
# SPDX-License-Identifier: MIT | ||
|
||
name: OpenAPI | ||
|
||
on: pull_request | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: openapi-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
openapi: | ||
runs-on: ubuntu-latest | ||
|
||
if: ${{ github.repository_owner != 'nextcloud-gmbh' }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
|
||
- name: Get php version | ||
id: php_versions | ||
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 | ||
|
||
- name: Set up php | ||
uses: shivammathur/setup-php@2e947f1f6932d141d076ca441d0e1e881775e95b # v2.31.0 | ||
with: | ||
php-version: ${{ steps.php_versions.outputs.php-available }} | ||
extensions: xml | ||
coverage: none | ||
ini-file: development | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Check Typescript OpenApi types | ||
id: check_typescript_openapi | ||
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 | ||
with: | ||
files: "src/types/openapi/openapi*.ts" | ||
|
||
- name: Read package.json node and npm engines version | ||
if: steps.check_typescript_openapi.outputs.files_exists == 'true' | ||
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 | ||
id: node_versions | ||
# Continue if no package.json | ||
continue-on-error: true | ||
with: | ||
fallbackNode: '^20' | ||
fallbackNpm: '^10' | ||
|
||
- name: Set up node ${{ steps.node_versions.outputs.nodeVersion }} | ||
if: ${{ steps.node_versions.outputs.nodeVersion }} | ||
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | ||
with: | ||
node-version: ${{ steps.node_versions.outputs.nodeVersion }} | ||
|
||
- name: Set up npm ${{ steps.node_versions.outputs.npmVersion }} | ||
if: ${{ steps.node_versions.outputs.nodeVersion }} | ||
run: npm i -g 'npm@${{ steps.node_versions.outputs.npmVersion }}' | ||
|
||
- name: Install dependencies & build | ||
if: ${{ steps.node_versions.outputs.nodeVersion }} | ||
env: | ||
CYPRESS_INSTALL_BINARY: 0 | ||
PUPPETEER_SKIP_DOWNLOAD: true | ||
run: | | ||
npm ci | ||
- name: Set up dependencies | ||
run: composer i | ||
|
||
- name: Regenerate OpenAPI | ||
run: composer run openapi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ before_cmds = [ | |
"composer install --no-dev -o", | ||
"npm install --deps", | ||
"npm run build", | ||
"composer openapi" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"config": { | ||
"platform": { | ||
"php": "8.1" | ||
}, | ||
"sort-packages": true | ||
}, | ||
"require": { | ||
"nextcloud/openapi-extractor": "dev-main" | ||
}, | ||
"repositories": [ | ||
{ | ||
"type": "vcs", | ||
"url": "https://github.com/nextcloud/openapi-extractor" | ||
} | ||
] | ||
} |
Oops, something went wrong.