Skip to content

Commit dcc4514

Browse files
authored
Merge pull request #272 from nextcloud/automated/update-workflows
chore: update workflows from templates
2 parents 8c74efa + fd8d5ca commit dcc4514

14 files changed

Lines changed: 821 additions & 1903 deletions

.github/workflows/appstore-build-publish.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# This workflow is adjusted compared to the one from the template to setup rust+cross
22

3-
43
name: Build and publish app release
54

65
on:
@@ -47,7 +46,7 @@ jobs:
4746
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
4847
4948
- name: Checkout
50-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
49+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
5150
with:
5251
path: ${{ env.APP_NAME }}
5352

@@ -59,7 +58,7 @@ jobs:
5958
expression: "//info//dependencies//nextcloud/@min-version"
6059

6160
- name: Read package.json node and npm engines version
62-
uses: skjnldsv/read-package-engines-version-actions@1bdcee71fa343c46b18dc6aceffb4cd1e35209c6 # v1.2
61+
uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1
6362
id: versions
6463
# Continue if no package.json
6564
continue-on-error: true
@@ -71,7 +70,7 @@ jobs:
7170
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
7271
# Skip if no package.json
7372
if: ${{ steps.versions.outputs.nodeVersion }}
74-
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3
73+
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
7574
with:
7675
node-version: ${{ steps.versions.outputs.nodeVersion }}
7776

@@ -81,7 +80,7 @@ jobs:
8180
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
8281

8382
- name: Set up php ${{ env.PHP_VERSION }}
84-
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2
83+
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
8584
with:
8685
php-version: ${{ env.PHP_VERSION }}
8786
coverage: none
@@ -141,7 +140,7 @@ jobs:
141140
unzip latest-$NCVERSION.zip
142141
143142
- name: Checkout server master fallback
144-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
143+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
145144
if: ${{ steps.server-checkout.outcome != 'success' }}
146145
with:
147146
submodules: true
@@ -164,7 +163,7 @@ jobs:
164163
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}
165164
166165
- name: Attach tarball to github release
167-
uses: svenstaro/upload-release-action@133984371c30d34e38222a64855679a414cb7575 # v2
166+
uses: svenstaro/upload-release-action@2b9d2847a97b04d02ad5c3df2d3a27baa97ce689 # v2
168167
id: attach_to_release
169168
with:
170169
repo_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint-info-xml.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# https://github.com/nextcloud/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55

6-
name: Lint
6+
name: Lint info.xml
77

88
on:
99
pull_request:
@@ -13,20 +13,27 @@ on:
1313
- master
1414
- stable*
1515

16+
permissions:
17+
contents: read
18+
19+
concurrency:
20+
group: lint-info-xml-${{ github.head_ref || github.run_id }}
21+
cancel-in-progress: true
22+
1623
jobs:
1724
xml-linters:
1825
runs-on: ubuntu-latest
1926

2027
name: info.xml lint
2128
steps:
2229
- name: Checkout
23-
uses: actions/checkout@v3
30+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
2431

2532
- name: Download schema
2633
run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd
2734

2835
- name: Lint info.xml
29-
uses: ChristophWurst/xmllint-action@v1
36+
uses: ChristophWurst/xmllint-action@39155a91429af431d65fafc21fa52ba5c4f5cb71 # v1.1
3037
with:
3138
xml-file: ./appinfo/info.xml
3239
xml-schema-file: ./info.xsd

.github/workflows/lint-php-cs.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# https://github.com/nextcloud/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55

6-
name: Lint
6+
name: Lint php-cs
77

88
on: pull_request
99

@@ -22,13 +22,16 @@ jobs:
2222

2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
2626

2727
- name: Set up php
28-
uses: shivammathur/setup-php@v2
28+
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
2929
with:
30-
php-version: "8.0"
30+
php-version: 8.1
3131
coverage: none
32+
ini-file: development
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3235

3336
- name: Install dependencies
3437
run: composer i

.github/workflows/lint-php.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# https://github.com/nextcloud/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55

6-
name: Lint
6+
name: Lint php
77

88
on:
99
pull_request:
@@ -16,7 +16,7 @@ on:
1616
permissions:
1717
contents: read
1818

19-
concurrency:
19+
concurrency:
2020
group: lint-php-${{ github.head_ref || github.run_id }}
2121
cancel-in-progress: true
2222

@@ -25,19 +25,22 @@ jobs:
2525
runs-on: ubuntu-latest
2626
strategy:
2727
matrix:
28-
php-versions: ["7.4", "8.0", "8.1"]
28+
php-versions: [ "8.0", "8.1", "8.2" ]
2929

3030
name: php-lint
3131

3232
steps:
3333
- name: Checkout
34-
uses: actions/checkout@v3
34+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
3535

3636
- name: Set up php ${{ matrix.php-versions }}
37-
uses: shivammathur/setup-php@v2
37+
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
3838
with:
3939
php-version: ${{ matrix.php-versions }}
4040
coverage: none
41+
ini-file: development
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4144

4245
- name: Lint
4346
run: composer run lint

.github/workflows/phpunit-mysql.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# https://github.com/nextcloud/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55

6-
name: PHPUnit
6+
name: PHPUnit mysql
77

88
on:
99
pull_request:
@@ -38,12 +38,12 @@ jobs:
3838

3939
strategy:
4040
matrix:
41-
php-versions: ['8.0', '8.1']
42-
server-versions: ['master', 'stable26']
41+
php-versions: ['8.0', '8.1', '8.2']
42+
server-versions: ['master']
4343

4444
services:
4545
mysql:
46-
image: mariadb:10.5
46+
image: ghcr.io/nextcloud/continuous-integration-mariadb-10.6:latest
4747
ports:
4848
- 4444:3306/tcp
4949
env:
@@ -58,27 +58,30 @@ jobs:
5858
5959
- name: Enable ONLY_FULL_GROUP_BY MySQL option
6060
run: |
61+
sleep 20
6162
echo "SET GLOBAL sql_mode=(SELECT CONCAT(@@sql_mode,',ONLY_FULL_GROUP_BY'));" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword
6263
echo "SELECT @@sql_mode;" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword
6364
6465
- name: Checkout server
65-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
66+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
6667
with:
6768
submodules: true
6869
repository: nextcloud/server
6970
ref: ${{ matrix.server-versions }}
7071

7172
- name: Checkout app
72-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
73+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
7374
with:
7475
path: apps/${{ env.APP_NAME }}
7576

7677
- name: Set up php ${{ matrix.php-versions }}
77-
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2
78+
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
7879
with:
7980
php-version: ${{ matrix.php-versions }}
80-
extensions: mbstring, iconv, fileinfo, intl, mysql, pdo_mysql
81+
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
82+
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, mysql, pdo_mysql
8183
coverage: none
84+
ini-file: development
8285
env:
8386
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8487

@@ -99,7 +102,7 @@ jobs:
99102
DB_PORT: 4444
100103
run: |
101104
mkdir data
102-
./occ maintenance:install --verbose --database=mysql --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
105+
./occ maintenance:install --verbose --database=mysql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
103106
./occ app:enable --force ${{ env.APP_NAME }}
104107
105108
- name: Check PHPUnit script is defined
@@ -133,6 +136,11 @@ jobs:
133136
working-directory: apps/${{ env.APP_NAME }}
134137
run: composer run test:integration
135138

139+
- name: Print logs
140+
if: always()
141+
run: |
142+
cat data/nextcloud.log
143+
136144
- name: Skipped
137145
# Fail the action when neither unit nor integration tests ran
138146
if: steps.check_phpunit.outcome == 'failure' && steps.check_integration.outcome == 'failure'

.github/workflows/phpunit-oci.yml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# https://github.com/nextcloud/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55

6-
name: PHPUnit
6+
name: PHPUnit OCI
77

88
on:
99
pull_request:
@@ -43,34 +43,51 @@ jobs:
4343

4444
services:
4545
oracle:
46-
image: deepdiver/docker-oracle-xe-11g # 'wnameless/oracle-xe-11g-r2'
46+
image: ghcr.io/gvenzl/oracle-xe:11
47+
48+
# Provide passwords and other environment variables to container
49+
env:
50+
ORACLE_RANDOM_PASSWORD: true
51+
APP_USER: autotest
52+
APP_USER_PASSWORD: owncloud
53+
54+
# Forward Oracle port
4755
ports:
4856
- 1521:1521/tcp
4957

58+
# Provide healthcheck script options for startup
59+
options: >-
60+
--health-cmd healthcheck.sh
61+
--health-interval 10s
62+
--health-timeout 5s
63+
--health-retries 10
64+
5065
steps:
5166
- name: Set app env
5267
run: |
5368
# Split and keep last
5469
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
5570
5671
- name: Checkout server
57-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
72+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
5873
with:
5974
submodules: true
6075
repository: nextcloud/server
6176
ref: ${{ matrix.server-versions }}
6277

6378
- name: Checkout app
64-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
79+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
6580
with:
6681
path: apps/${{ env.APP_NAME }}
6782

6883
- name: Set up php ${{ matrix.php-versions }}
69-
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2
84+
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
7085
with:
7186
php-version: ${{ matrix.php-versions }}
72-
extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, oci8
87+
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
88+
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, oci8
7389
coverage: none
90+
ini-file: development
7491
env:
7592
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7693

@@ -125,6 +142,11 @@ jobs:
125142
working-directory: apps/${{ env.APP_NAME }}
126143
run: composer run test:integration
127144

145+
- name: Print logs
146+
if: always()
147+
run: |
148+
cat data/nextcloud.log
149+
128150
- name: Skipped
129151
# Fail the action when neither unit nor integration tests ran
130152
if: steps.check_phpunit.outcome == 'failure' && steps.check_integration.outcome == 'failure'

0 commit comments

Comments
 (0)