Skip to content

Commit cf40a66

Browse files
committed
chore(workflows): remove cypress cloud
and allow regular cypress tests to run on forks (no secret leaked) add consistent gating for changes remove empty matrix option skip performance workflow on forks without it looking like it's failing Signed-off-by: Anna Larch <anna@nextcloud.com>
1 parent 3904da9 commit cf40a66

13 files changed

Lines changed: 158 additions & 109 deletions

.github/workflows/autocheckers.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ jobs:
7474
autocheckers:
7575
runs-on: ubuntu-latest-low
7676

77+
needs: changes
78+
if: needs.changes.outputs.src != 'false'
79+
7780
strategy:
7881
matrix:
7982
php-versions: ['8.2']
@@ -125,4 +128,4 @@ jobs:
125128

126129
steps:
127130
- name: Summary status
128-
run: if ${{ needs.autocheckers.result != 'success' || (needs.changes.outputs.src != 'false' && needs.autoloader.result != 'success') }}; then exit 1; fi
131+
run: if ${{ needs.changes.outputs.src != 'false' && (needs.autocheckers.result != 'success' || needs.autoloader.result != 'success') }}; then exit 1; fi

.github/workflows/command-pull-3rdparty.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,23 @@ jobs:
2727
comment-id: ${{ github.event.comment.id }}
2828
reactions: '+1'
2929

30+
- name: Get repository from pull request comment
31+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
32+
id: get-repository
33+
with:
34+
github-token: ${{ secrets.GITHUB_TOKEN }}
35+
script: |
36+
const pull = await github.rest.pulls.get({
37+
owner: context.repo.owner,
38+
repo: context.repo.repo,
39+
pull_number: context.issue.number
40+
});
41+
const repositoryName = pull.data.head?.repo?.full_name
42+
console.log(repositoryName)
43+
return repositoryName
44+
3045
- name: Disabled on forks
31-
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
46+
if: ${{ fromJSON(steps.get-repository.outputs.result) != github.repository }}
3247
run: |
3348
echo 'Can not execute /update-3rdparty on forks'
3449
exit 1

.github/workflows/cypress.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@ jobs:
4141
PUPPETEER_SKIP_DOWNLOAD: true
4242

4343
steps:
44-
- name: Disabled on forks
45-
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
46-
run: |
47-
echo 'Can not run cypress on forks'
48-
exit 1
49-
5044
- name: Checkout server
5145
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5246
with:
@@ -176,10 +170,6 @@ jobs:
176170
# We already installed the dependencies in the init job
177171
install: false
178172
component: ${{ matrix.containers == 'component' }}
179-
group: ${{ matrix.use-cypress-cloud && matrix.containers == 'component' && 'Run component' || matrix.use-cypress-cloud && 'Run E2E' || '' }}
180-
# cypress env
181-
ci-build-id: ${{ matrix.use-cypress-cloud && format('{0}-{1}', github.sha, github.run_number) || '' }}
182-
tag: ${{ matrix.use-cypress-cloud && github.event_name || '' }}
183173
env:
184174
# Needs to be prefixed with CYPRESS_
185175
CYPRESS_BRANCH: ${{ env.BRANCH }}
@@ -188,7 +178,6 @@ jobs:
188178
# Needed for some specific code workarounds
189179
TESTING: true
190180
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
191-
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
192181
SPLIT: ${{ matrix.total-containers }}
193182
SPLIT_INDEX: ${{ matrix.containers == 'component' && 0 || matrix.containers }}
194183
SPLIT_RANDOM_SEED: ${{ github.run_id }}

.github/workflows/files-external-sftp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
- name: Set up sftpd
7474
run: |
7575
sudo mkdir /tmp/sftp
76-
sudo chown -R 0777 /tmp/sftp
76+
sudo chmod -R 0777 /tmp/sftp
7777
if [[ '${{ matrix.sftpd }}' == 'openssh' ]]; then docker run -p 2222:22 --name sftp -d -v /tmp/sftp:/home/test atmoz/sftp 'test:test:::data'; fi
7878
7979
- name: Set up php ${{ matrix.php-versions }}

.github/workflows/integration-dav.yml

Lines changed: 82 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@ jobs:
2020

2121
steps:
2222
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
23-
id: changes
24-
continue-on-error: true
25-
with:
26-
filters: |
27-
src:
28-
- '.github/workflows/**'
29-
- '3rdparty/**'
30-
- '**/*.php'
31-
- '**/lib/**'
32-
- '**/tests/**'
33-
- '**/vendor-bin/**'
34-
- 'build/integration/**'
35-
- '.php-cs-fixer.dist.php'
36-
- 'composer.json'
37-
- 'composer.lock'
23+
id: changes
24+
continue-on-error: true
25+
with:
26+
filters: |
27+
src:
28+
- '.github/workflows/**'
29+
- '3rdparty/**'
30+
- '**/*.php'
31+
- '**/lib/**'
32+
- '**/tests/**'
33+
- '**/vendor-bin/**'
34+
- 'build/integration/**'
35+
- '.php-cs-fixer.dist.php'
36+
- 'composer.json'
37+
- 'composer.lock'
3838
3939
integration-caldav:
4040
runs-on: ubuntu-latest
@@ -45,76 +45,76 @@ jobs:
4545
strategy:
4646
fail-fast: false
4747
matrix:
48-
php-versions: ['8.2']
49-
endpoint: ['old', 'new']
50-
service: ['CalDAV', 'CardDAV']
48+
php-versions: ['8.2']
49+
endpoint: ['old', 'new']
50+
service: ['CalDAV', 'CardDAV']
5151

5252
name: ${{ matrix.service }} (${{ matrix.endpoint }} endpoint) php${{ matrix.php-versions }}
5353

5454
steps:
55-
- name: Checkout server
56-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
57-
with:
58-
persist-credentials: false
59-
submodules: true
60-
61-
- name: Set up php ${{ matrix.php-versions }}
62-
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 #v2.36.0
63-
timeout-minutes: 5
64-
with:
65-
php-version: ${{ matrix.php-versions }}
66-
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
67-
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, redis, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
68-
coverage: 'none'
69-
ini-file: development
70-
env:
71-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72-
73-
- name: Set up Python
74-
uses: LizardByte/actions/actions/setup_python@70bb8d394d1c92f6113aeec6ae9cc959a5763d15 # v2026.227.200013
75-
with:
76-
python-version: '2.7'
77-
78-
- name: Set up CalDAVTester
79-
run: |
80-
git clone --depth=1 https://github.com/apple/ccs-caldavtester.git CalDAVTester
81-
git clone --depth=1 https://github.com/apple/ccs-pycalendar.git pycalendar
82-
83-
- name: Set up Nextcloud
84-
run: |
85-
mkdir data
86-
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
87-
# disable the trashbin, so recurrent deletion of the same object works
88-
./occ config:app:set dav calendarRetentionObligation --value=0
89-
# Prepare users
90-
OC_PASS=user01 ./occ user:add --password-from-env user01
91-
OC_PASS=user02 ./occ user:add --password-from-env user02
92-
# Prepare calendars
93-
./occ dav:create-calendar user01 calendar
94-
./occ dav:create-calendar user01 shared
95-
./occ dav:create-calendar user02 calendar
96-
# Prepare address books
97-
./occ dav:create-addressbook user01 addressbook
98-
./occ dav:create-addressbook user02 addressbook
99-
100-
- name: Run Nextcloud
101-
run: |
102-
php -S localhost:8888 &
103-
104-
- name: Run CalDAVTester
105-
run: |
106-
cp "apps/dav/tests/testsuits/caldavtest/serverinfo-${{ matrix.endpoint }}${{ matrix.endpoint == 'old' && (matrix.service == 'CardDAV' && '-carddav' || '-caldav') || '' }}-endpoint.xml" "apps/dav/tests/testsuits/caldavtest/serverinfo.xml"
107-
pushd CalDAVTester
108-
PYTHONPATH="../pycalendar/src" python testcaldav.py --print-details-onfail --basedir "../apps/dav/tests/testsuits/caldavtest" -o cdt.txt \
109-
"${{ matrix.service }}/current-user-principal.xml" \
110-
"${{ matrix.service }}/sync-report.xml" \
111-
${{ matrix.endpoint == 'new' && format('{0}/sharing-{1}.xml', matrix.service, matrix.service == 'CalDAV' && 'calendars' || 'addressbooks') || ';' }}
112-
popd
113-
114-
- name: Print Nextcloud logs
115-
if: always()
116-
run: |
117-
cat data/nextcloud.log
55+
- name: Checkout server
56+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
57+
with:
58+
persist-credentials: false
59+
submodules: true
60+
61+
- name: Set up php ${{ matrix.php-versions }}
62+
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 #v2.36.0
63+
timeout-minutes: 5
64+
with:
65+
php-version: ${{ matrix.php-versions }}
66+
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
67+
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, redis, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
68+
coverage: 'none'
69+
ini-file: development
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
73+
- name: Set up Python
74+
uses: LizardByte/actions/actions/setup_python@70bb8d394d1c92f6113aeec6ae9cc959a5763d15 # v2026.227.200013
75+
with:
76+
python-version: '2.7'
77+
78+
- name: Set up CalDAVTester
79+
run: |
80+
git clone --depth=1 https://github.com/apple/ccs-caldavtester.git CalDAVTester
81+
git clone --depth=1 https://github.com/apple/ccs-pycalendar.git pycalendar
82+
83+
- name: Set up Nextcloud
84+
run: |
85+
mkdir data
86+
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
87+
# disable the trashbin, so recurrent deletion of the same object works
88+
./occ config:app:set dav calendarRetentionObligation --value=0
89+
# Prepare users
90+
OC_PASS=user01 ./occ user:add --password-from-env user01
91+
OC_PASS=user02 ./occ user:add --password-from-env user02
92+
# Prepare calendars
93+
./occ dav:create-calendar user01 calendar
94+
./occ dav:create-calendar user01 shared
95+
./occ dav:create-calendar user02 calendar
96+
# Prepare address books
97+
./occ dav:create-addressbook user01 addressbook
98+
./occ dav:create-addressbook user02 addressbook
99+
100+
- name: Run Nextcloud
101+
run: |
102+
php -S localhost:8888 &
103+
104+
- name: Run CalDAVTester
105+
run: |
106+
cp "apps/dav/tests/testsuits/caldavtest/serverinfo-${{ matrix.endpoint }}${{ matrix.endpoint == 'old' && (matrix.service == 'CardDAV' && '-carddav' || '-caldav') || '' }}-endpoint.xml" "apps/dav/tests/testsuits/caldavtest/serverinfo.xml"
107+
pushd CalDAVTester
108+
PYTHONPATH="../pycalendar/src" python testcaldav.py --print-details-onfail --basedir "../apps/dav/tests/testsuits/caldavtest" -o cdt.txt \
109+
"${{ matrix.service }}/current-user-principal.xml" \
110+
"${{ matrix.service }}/sync-report.xml" \
111+
${{ matrix.endpoint == 'new' && format('{0}/sharing-{1}.xml', matrix.service, matrix.service == 'CalDAV' && 'calendars' || 'addressbooks') || ';' }}
112+
popd
113+
114+
- name: Print Nextcloud logs
115+
if: always()
116+
run: |
117+
cat data/nextcloud.log
118118
119119
caldav-integration-summary:
120120
permissions:
@@ -126,4 +126,4 @@ jobs:
126126

127127
steps:
128128
- name: Summary status
129-
run: if ${{ needs.changes.outputs.src != 'false' && needs.integration-caldav.result != 'success' }}; then exit 1; fi
129+
run: if ${{ needs.changes.outputs.src != 'false' && needs.integration-caldav.result != 'success' }}; then exit 1; fi

.github/workflows/integration-s3-primary.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ jobs:
9595

9696
- name: Wait for S3
9797
run: |
98-
sleep 10
9998
curl -f -m 1 --retry-connrefused --retry 10 --retry-delay 10 http://localhost:9000/minio/health/ready
10099
101100
- name: Set up Nextcloud

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ jobs:
4444
lint:
4545
runs-on: ubuntu-latest
4646

47+
needs: changes
48+
if: needs.changes.outputs.src != 'false'
49+
4750
name: php-cs
4851

4952
steps:

.github/workflows/lint-stylelint.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,37 @@ concurrency:
1818
cancel-in-progress: true
1919

2020
jobs:
21+
changes:
22+
runs-on: ubuntu-latest-low
23+
permissions:
24+
contents: read
25+
pull-requests: read
26+
27+
outputs:
28+
src: ${{ steps.changes.outputs.src }}
29+
30+
steps:
31+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
32+
id: changes
33+
continue-on-error: true
34+
with:
35+
filters: |
36+
src:
37+
- '.github/workflows/**'
38+
- '**/src/**'
39+
- '**/appinfo/info.xml'
40+
- 'package.json'
41+
- 'package-lock.json'
42+
- '**.css'
43+
- '**.scss'
44+
- '**.vue'
45+
2146
lint:
2247
runs-on: ubuntu-latest
2348

49+
needs: changes
50+
if: needs.changes.outputs.src != 'false'
51+
2452
name: stylelint
2553

2654
steps:
@@ -51,3 +79,18 @@ jobs:
5179

5280
- name: Lint
5381
run: npm run stylelint
82+
83+
summary:
84+
permissions:
85+
contents: none
86+
runs-on: ubuntu-latest-low
87+
needs: [changes, lint]
88+
89+
if: always()
90+
91+
# This is the summary, we just avoid to rename it so that branch protection rules still match
92+
name: stylelint
93+
94+
steps:
95+
- name: Summary status
96+
run: if ${{ needs.changes.outputs.src != 'false' && needs.lint.result != 'success' }}; then exit 1; fi

.github/workflows/node-test.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ jobs:
8383
run: |
8484
npm ci
8585
86-
# - name: Test
87-
# run: npm run test --if-present
88-
8986
- name: Test and process coverage
9087
run: npm run test:coverage
9188

.github/workflows/object-storage-s3.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ jobs:
111111
112112
- name: Wait for S3
113113
run: |
114-
sleep 10
115114
curl -f -m 1 --retry-connrefused --retry 10 --retry-delay 10 http://localhost:9000/minio/health/ready
116115
117116
- name: PHPUnit

0 commit comments

Comments
 (0)