|
7 | 7 | name: CI |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - unittest-linting: |
11 | | - name: unit tests and linting |
12 | | - strategy: |
13 | | - matrix: |
14 | | - nextcloudVersion: [ stable30, master ] |
15 | | - phpVersion: [ 8.1, 8.2, 8.3 ] |
16 | | - # This condition is temporary and can be removed once Nextcloud 31 support is added in the integration app for the release/2.7 branch |
17 | | - isReleaseBranch: |
18 | | - - ${{ inputs.branch == 'release/2.7'}} |
19 | | - include: |
20 | | - - nextcloudVersion: stable27 |
21 | | - phpVersion: 8.0 |
22 | | - - nextcloudVersion: stable28 |
23 | | - phpVersion: 8.1 |
24 | | - - nextcloudVersion: stable29 |
25 | | - phpVersion: 8.1 |
26 | | - exclude: |
27 | | - - isReleaseBranch: true |
28 | | - nextcloudVersion: master |
29 | | - - isReleaseBranch: false |
30 | | - nextcloudVersion: master |
31 | | - phpVersion: 8.1 |
32 | | - - isReleaseBranch: false |
33 | | - nextcloudVersion: master |
34 | | - phpVersion: 8.2 |
35 | | - runs-on: ubuntu-20.04 |
36 | | - steps: |
37 | | - - name: Checkout for nightly CI |
38 | | - if: github.event_name == 'schedule' |
39 | | - uses: actions/checkout@v3 |
40 | | - with: |
41 | | - ref: ${{ inputs.branch }} |
42 | | - |
43 | | - - name: Checkout |
44 | | - if: github.event_name != 'schedule' |
45 | | - uses: actions/checkout@v3 |
46 | | - |
47 | | - - name: Setup PHP ${{ matrix.phpVersion }} |
48 | | - uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d |
49 | | - with: |
50 | | - php-version: ${{ matrix.phpVersion }} |
51 | | - tools: composer, phpunit |
52 | | - coverage: xdebug |
53 | | - extensions: gd, sqlite3 |
54 | | - |
55 | | - - name: Get composer cache directory |
56 | | - id: composer-cache |
57 | | - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
58 | | - |
59 | | - - name: Cache PHP dependencies |
60 | | - uses: actions/cache@v3 |
61 | | - with: |
62 | | - path: ${{ steps.composer-cache.outputs.dir }} |
63 | | - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
64 | | - restore-keys: ${{ runner.os }}-composer- |
65 | | - |
66 | | - - name: Read package.json node and npm engines version |
67 | | - uses: skjnldsv/read-package-engines-version-actions@v2 |
68 | | - id: versions |
69 | | - with: |
70 | | - fallbackNode: '^14' |
71 | | - fallbackNpm: '^7' |
72 | | - |
73 | | - - name: Setup NodeJS ${{ steps.versions.outputs.nodeVersion }} |
74 | | - uses: actions/setup-node@v3 |
75 | | - with: |
76 | | - node-version: ${{ steps.versions.outputs.nodeVersion }} |
77 | | - cache: 'npm' |
78 | | - |
79 | | - - name: Setup NPM ${{ steps.versions.outputs.npmVersion }} |
80 | | - run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" |
81 | | - |
82 | | - - name: Install PHP Dependencies |
83 | | - run: | |
84 | | - # The following if block can be removed once Nextcloud no longer supports PHP 8.0 |
85 | | - if [ "${{matrix.phpVersion}}" -eq 8 ]; then |
86 | | - # Composer updated to php 8.0 with pact 7.1 because pact 10.0.0-beta2 is incompatible with php 8.0. |
87 | | - sed -i 's/10.0.0-beta2/7.1/g' composer.json |
88 | | - composer update |
89 | | - fi |
90 | | - composer install --no-progress --prefer-dist --optimize-autoloader |
91 | | - git clone --depth 1 https://github.com/nextcloud/server.git -b ${{ matrix.nextcloudVersion }} |
92 | | - cd server && git submodule update --init |
93 | | - ./occ maintenance:install --admin-pass=admin |
94 | | -
|
95 | | - - name: PHP code analysis |
96 | | - run: | |
97 | | - # The following if block can be removed once Nextcloud no longer supports PHP 8.0 |
98 | | - if [ "${{matrix.phpVersion}}" -eq 8 ]; then |
99 | | - # Ignoring the pact test for php 8.0 |
100 | | - sed -i '/<ignoreFiles>/a \ <file name="tests/lib/Service/OpenProjectAPIServiceTest.php"/>' psalm.xml |
101 | | - fi |
102 | | - make psalm |
103 | | -
|
104 | | - - name: PHP code style |
105 | | - run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 ) |
106 | | - |
107 | | - - name: Install NPM Dependencies |
108 | | - run: npm install |
109 | | - |
110 | | - - name: JS Lint |
111 | | - run: npm run lint |
112 | | - |
113 | | - - name: Style Lint |
114 | | - run: npm run stylelint |
115 | | - |
116 | | - - name: PHP & Vue Unit Tests |
117 | | - run: | |
118 | | - git clone --depth 1 https://github.com/nextcloud/groupfolders.git -b ${{ matrix.nextcloudVersion }} server/apps/groupfolders |
119 | | - mkdir -p server/apps/integration_openproject |
120 | | - cp -r `ls -A | grep -v 'server'` server/apps/integration_openproject/ |
121 | | - cd server |
122 | | - ./occ a:e groupfolders |
123 | | - ./occ a:e integration_openproject |
124 | | - cd apps/integration_openproject |
125 | | - # The following if block can be removed once Nextcloud no longer supports PHP 8.0 |
126 | | - if [ "${{ matrix.phpVersion }}" -eq 8 ]; then |
127 | | - make phpunitforphp8.0 || (echo "A few of the unit tests were unsuccessful. Rerunning the unit test once again......" && make phpunitforphp8.0) |
128 | | - else |
129 | | - make phpunit || (echo "A few of the unit tests were unsuccessful. Rerunning the unit test once again......" && make phpunit) |
130 | | - fi |
131 | | - make jsunit |
132 | | -
|
133 | | - - name: JS Code Coverage Summary Report |
134 | | - if: ${{ github.event_name == 'pull_request' && matrix.nextcloudVersion == 'stable29' && matrix.phpVersion == '8.1' }} |
135 | | - |
136 | | - with: |
137 | | - github-token: ${{ secrets.GITHUB_TOKEN }} |
138 | | - lcov-file: ./server/apps/integration_openproject/coverage/jest/lcov.info |
139 | | - delete-old-comments: true |
140 | | - title: "JS Code Coverage" |
141 | | - |
142 | | - - name: Setup .NET Core # this is required to execute Convert PHP cobertura coverage to lcov step |
143 | | - if: ${{ github.event_name == 'pull_request' && matrix.nextcloudVersion == 'stable29' && matrix.phpVersion == '8.1' }} |
144 | | - uses: actions/setup-dotnet@v3 |
145 | | - with: |
146 | | - dotnet-version: 6.0.101 |
147 | | - dotnet-quality: 'ga' |
148 | | - |
149 | | - - name: Convert PHP cobertura coverage to lcov |
150 | | - if: ${{ github.event_name == 'pull_request' && matrix.nextcloudVersion == 'stable29' && matrix.phpVersion == '8.1' }} |
151 | | - uses: danielpalme/[email protected] |
152 | | - with: |
153 | | - reports: './server/apps/integration_openproject/coverage/php/cobertura.xml' # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported. |
154 | | - targetdir: './server/apps/integration_openproject/coverage/php' # REQUIRED # The directory where the generated report should be saved. |
155 | | - reporttypes: 'lcov' # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MarkdownSummary, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, Xml, XmlSummary |
156 | | - sourcedirs: '' # Optional directories which contain the corresponding source code (separated by semicolon). The source directories are used if coverage report contains classes without path information. |
157 | | - historydir: '' # Optional directory for storing persistent coverage information. Can be used in future reports to show coverage evolution. |
158 | | - plugins: '' # Optional plugin files for custom reports or custom history storage (separated by semicolon). |
159 | | - assemblyfilters: '+*' # Optional list of assemblies that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed. |
160 | | - classfilters: '+*' # Optional list of classes that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed. |
161 | | - filefilters: '+*' # Optional list of files that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed. |
162 | | - verbosity: 'Verbose' # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off |
163 | | - title: '' # Optional title. |
164 | | - tag: '${{ github.run_number }}_${{ github.run_id }}' # Optional tag or build version. |
165 | | - customSettings: '' # Optional custom settings (separated by semicolon). See: https://github.com/danielpalme/ReportGenerator/wiki/Settings. |
166 | | - toolpath: 'reportgeneratortool' # Default directory for installing the dotnet tool. |
167 | | - |
168 | | - - name: PHP Code Coverage Summary Report |
169 | | - if: ${{ github.event_name == 'pull_request' && matrix.nextcloudVersion == 'stable29' && matrix.phpVersion == '8.1' }} |
170 | | - |
171 | | - with: |
172 | | - github-token: ${{ secrets.GITHUB_TOKEN }} |
173 | | - lcov-file: ./server/apps/integration_openproject/coverage/php/lcov.info |
174 | | - delete-old-comments: true |
175 | | - title: "PHP Code Coverage" |
176 | | - |
177 | | - - name: JS coverage check |
178 | | - if: ${{ github.event_name == 'pull_request' && matrix.nextcloudVersion == 'stable29' && matrix.phpVersion == '8.1' }} |
179 | | - uses: VeryGoodOpenSource/very_good_coverage@v2 |
180 | | - with: |
181 | | - min_coverage: '59' |
182 | | - path: './server/apps/integration_openproject/coverage/jest/lcov.info' |
183 | | - |
184 | | - - name: PHP coverage check |
185 | | - if: ${{ github.event_name == 'pull_request' && matrix.nextcloudVersion == 'stable29' && matrix.phpVersion == '8.1' }} |
186 | | - uses: VeryGoodOpenSource/very_good_coverage@v2 |
187 | | - with: |
188 | | - min_coverage: '56' |
189 | | - path: './server/apps/integration_openproject/coverage/php/lcov.info' |
| 10 | + # unittest-linting: |
| 11 | + # name: unit tests and linting |
| 12 | + # strategy: |
| 13 | + # matrix: |
| 14 | + # nextcloudVersion: [ stable30, master ] |
| 15 | + # phpVersion: [ 8.1, 8.2, 8.3 ] |
| 16 | + # # This condition is temporary and can be removed once Nextcloud 31 support is added in the integration app for the release/2.7 branch |
| 17 | + # isReleaseBranch: |
| 18 | + # - ${{ inputs.branch == 'release/2.7'}} |
| 19 | + # include: |
| 20 | + # - nextcloudVersion: stable27 |
| 21 | + # phpVersion: 8.0 |
| 22 | + # - nextcloudVersion: stable28 |
| 23 | + # phpVersion: 8.1 |
| 24 | + # - nextcloudVersion: stable29 |
| 25 | + # phpVersion: 8.1 |
| 26 | + # exclude: |
| 27 | + # - isReleaseBranch: true |
| 28 | + # nextcloudVersion: master |
| 29 | + # - isReleaseBranch: false |
| 30 | + # nextcloudVersion: master |
| 31 | + # phpVersion: 8.1 |
| 32 | + # - isReleaseBranch: false |
| 33 | + # nextcloudVersion: master |
| 34 | + # phpVersion: 8.2 |
| 35 | + # runs-on: ubuntu-20.04 |
| 36 | + # steps: |
| 37 | + # - name: Checkout for nightly CI |
| 38 | + # if: github.event_name == 'schedule' |
| 39 | + # uses: actions/checkout@v3 |
| 40 | + # with: |
| 41 | + # ref: ${{ inputs.branch }} |
| 42 | + |
| 43 | + # - name: Checkout |
| 44 | + # if: github.event_name != 'schedule' |
| 45 | + # uses: actions/checkout@v3 |
| 46 | + |
| 47 | + # - name: Setup PHP ${{ matrix.phpVersion }} |
| 48 | + # uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d |
| 49 | + # with: |
| 50 | + # php-version: ${{ matrix.phpVersion }} |
| 51 | + # tools: composer, phpunit |
| 52 | + # coverage: xdebug |
| 53 | + # extensions: gd, sqlite3 |
| 54 | + |
| 55 | + # - name: Get composer cache directory |
| 56 | + # id: composer-cache |
| 57 | + # run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
| 58 | + |
| 59 | + # - name: Cache PHP dependencies |
| 60 | + # uses: actions/cache@v3 |
| 61 | + # with: |
| 62 | + # path: ${{ steps.composer-cache.outputs.dir }} |
| 63 | + # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
| 64 | + # restore-keys: ${{ runner.os }}-composer- |
| 65 | + |
| 66 | + # - name: Read package.json node and npm engines version |
| 67 | + # uses: skjnldsv/read-package-engines-version-actions@v2 |
| 68 | + # id: versions |
| 69 | + # with: |
| 70 | + # fallbackNode: '^14' |
| 71 | + # fallbackNpm: '^7' |
| 72 | + |
| 73 | + # - name: Setup NodeJS ${{ steps.versions.outputs.nodeVersion }} |
| 74 | + # uses: actions/setup-node@v3 |
| 75 | + # with: |
| 76 | + # node-version: ${{ steps.versions.outputs.nodeVersion }} |
| 77 | + # cache: 'npm' |
| 78 | + |
| 79 | + # - name: Setup NPM ${{ steps.versions.outputs.npmVersion }} |
| 80 | + # run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" |
| 81 | + |
| 82 | + # - name: Install PHP Dependencies |
| 83 | + # run: | |
| 84 | + # # The following if block can be removed once Nextcloud no longer supports PHP 8.0 |
| 85 | + # if [ "${{matrix.phpVersion}}" -eq 8 ]; then |
| 86 | + # # Composer updated to php 8.0 with pact 7.1 because pact 10.0.0-beta2 is incompatible with php 8.0. |
| 87 | + # sed -i 's/10.0.0-beta2/7.1/g' composer.json |
| 88 | + # composer update |
| 89 | + # fi |
| 90 | + # composer install --no-progress --prefer-dist --optimize-autoloader |
| 91 | + # git clone --depth 1 https://github.com/nextcloud/server.git -b ${{ matrix.nextcloudVersion }} |
| 92 | + # cd server && git submodule update --init |
| 93 | + # ./occ maintenance:install --admin-pass=admin |
| 94 | + |
| 95 | + # - name: PHP code analysis |
| 96 | + # run: | |
| 97 | + # # The following if block can be removed once Nextcloud no longer supports PHP 8.0 |
| 98 | + # if [ "${{matrix.phpVersion}}" -eq 8 ]; then |
| 99 | + # # Ignoring the pact test for php 8.0 |
| 100 | + # sed -i '/<ignoreFiles>/a \ <file name="tests/lib/Service/OpenProjectAPIServiceTest.php"/>' psalm.xml |
| 101 | + # fi |
| 102 | + # make psalm |
| 103 | + |
| 104 | + # - name: PHP code style |
| 105 | + # run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 ) |
| 106 | + |
| 107 | + # - name: Install NPM Dependencies |
| 108 | + # run: npm install |
| 109 | + |
| 110 | + # - name: JS Lint |
| 111 | + # run: npm run lint |
| 112 | + |
| 113 | + # - name: Style Lint |
| 114 | + # run: npm run stylelint |
| 115 | + |
| 116 | + # - name: PHP & Vue Unit Tests |
| 117 | + # run: | |
| 118 | + # git clone --depth 1 https://github.com/nextcloud/groupfolders.git -b ${{ matrix.nextcloudVersion }} server/apps/groupfolders |
| 119 | + # mkdir -p server/apps/integration_openproject |
| 120 | + # cp -r `ls -A | grep -v 'server'` server/apps/integration_openproject/ |
| 121 | + # cd server |
| 122 | + # ./occ a:e groupfolders |
| 123 | + # ./occ a:e integration_openproject |
| 124 | + # cd apps/integration_openproject |
| 125 | + # # The following if block can be removed once Nextcloud no longer supports PHP 8.0 |
| 126 | + # if [ "${{ matrix.phpVersion }}" -eq 8 ]; then |
| 127 | + # make phpunitforphp8.0 || (echo "A few of the unit tests were unsuccessful. Rerunning the unit test once again......" && make phpunitforphp8.0) |
| 128 | + # else |
| 129 | + # make phpunit || (echo "A few of the unit tests were unsuccessful. Rerunning the unit test once again......" && make phpunit) |
| 130 | + # fi |
| 131 | + # make jsunit |
| 132 | + |
| 133 | + # - name: JS Code Coverage Summary Report |
| 134 | + # if: ${{ github.event_name == 'pull_request' && matrix.nextcloudVersion == 'stable29' && matrix.phpVersion == '8.1' }} |
| 135 | + |
| 136 | + # with: |
| 137 | + # github-token: ${{ secrets.GITHUB_TOKEN }} |
| 138 | + # lcov-file: ./server/apps/integration_openproject/coverage/jest/lcov.info |
| 139 | + # delete-old-comments: true |
| 140 | + # title: "JS Code Coverage" |
| 141 | + |
| 142 | + # - name: Setup .NET Core # this is required to execute Convert PHP cobertura coverage to lcov step |
| 143 | + # if: ${{ github.event_name == 'pull_request' && matrix.nextcloudVersion == 'stable29' && matrix.phpVersion == '8.1' }} |
| 144 | + # uses: actions/setup-dotnet@v3 |
| 145 | + # with: |
| 146 | + # dotnet-version: 6.0.101 |
| 147 | + # dotnet-quality: 'ga' |
| 148 | + |
| 149 | + # - name: Convert PHP cobertura coverage to lcov |
| 150 | + # if: ${{ github.event_name == 'pull_request' && matrix.nextcloudVersion == 'stable29' && matrix.phpVersion == '8.1' }} |
| 151 | + # uses: danielpalme/[email protected] |
| 152 | + # with: |
| 153 | + # reports: './server/apps/integration_openproject/coverage/php/cobertura.xml' # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported. |
| 154 | + # targetdir: './server/apps/integration_openproject/coverage/php' # REQUIRED # The directory where the generated report should be saved. |
| 155 | + # reporttypes: 'lcov' # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MarkdownSummary, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, Xml, XmlSummary |
| 156 | + # sourcedirs: '' # Optional directories which contain the corresponding source code (separated by semicolon). The source directories are used if coverage report contains classes without path information. |
| 157 | + # historydir: '' # Optional directory for storing persistent coverage information. Can be used in future reports to show coverage evolution. |
| 158 | + # plugins: '' # Optional plugin files for custom reports or custom history storage (separated by semicolon). |
| 159 | + # assemblyfilters: '+*' # Optional list of assemblies that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed. |
| 160 | + # classfilters: '+*' # Optional list of classes that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed. |
| 161 | + # filefilters: '+*' # Optional list of files that should be included or excluded in the report. Exclusion filters take precedence over inclusion filters. Wildcards are allowed. |
| 162 | + # verbosity: 'Verbose' # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off |
| 163 | + # title: '' # Optional title. |
| 164 | + # tag: '${{ github.run_number }}_${{ github.run_id }}' # Optional tag or build version. |
| 165 | + # customSettings: '' # Optional custom settings (separated by semicolon). See: https://github.com/danielpalme/ReportGenerator/wiki/Settings. |
| 166 | + # toolpath: 'reportgeneratortool' # Default directory for installing the dotnet tool. |
| 167 | + |
| 168 | + # - name: PHP Code Coverage Summary Report |
| 169 | + # if: ${{ github.event_name == 'pull_request' && matrix.nextcloudVersion == 'stable29' && matrix.phpVersion == '8.1' }} |
| 170 | + |
| 171 | + # with: |
| 172 | + # github-token: ${{ secrets.GITHUB_TOKEN }} |
| 173 | + # lcov-file: ./server/apps/integration_openproject/coverage/php/lcov.info |
| 174 | + # delete-old-comments: true |
| 175 | + # title: "PHP Code Coverage" |
| 176 | + |
| 177 | + # - name: JS coverage check |
| 178 | + # if: ${{ github.event_name == 'pull_request' && matrix.nextcloudVersion == 'stable29' && matrix.phpVersion == '8.1' }} |
| 179 | + # uses: VeryGoodOpenSource/very_good_coverage@v2 |
| 180 | + # with: |
| 181 | + # min_coverage: '59' |
| 182 | + # path: './server/apps/integration_openproject/coverage/jest/lcov.info' |
| 183 | + |
| 184 | + # - name: PHP coverage check |
| 185 | + # if: ${{ github.event_name == 'pull_request' && matrix.nextcloudVersion == 'stable29' && matrix.phpVersion == '8.1' }} |
| 186 | + # uses: VeryGoodOpenSource/very_good_coverage@v2 |
| 187 | + # with: |
| 188 | + # min_coverage: '56' |
| 189 | + # path: './server/apps/integration_openproject/coverage/php/lcov.info' |
190 | 190 |
|
191 | 191 | api-tests: |
192 | 192 | name: API tests |
193 | 193 | strategy: |
194 | 194 | matrix: |
195 | | - nextcloudVersion: [ stable30, master ] |
| 195 | + nextcloudVersion: [ stable30 ] |
196 | 196 | phpVersionMajor: [ 8 ] |
197 | 197 | phpVersionMinor: [ 1, 2, 3 ] |
198 | 198 | database: [ mysql ] |
|
0 commit comments