Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a CI job for WPCloud testing of wpcomsh. #39258

Open
wants to merge 35 commits into
base: trunk
Choose a base branch
from
Open
Changes from 2 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3a57a51
Added a CI job for WPCloud testing of wpcomsh.
zinigor Sep 5, 2024
2ab2c4a
Add pnpm and install.
zinigor Sep 5, 2024
0d40db9
Testing WPCloud on a new test site for jetpackisbestpack.
zinigor Oct 7, 2024
a8da4b4
Merge branch 'trunk' into add/wpcomsh-wpcloud-testing
zinigor Oct 7, 2024
a3a5533
Temporarily marking wpcomsh as always changed.
zinigor Oct 7, 2024
8b74cdf
Merge branch 'trunk' into add/wpcomsh-wpcloud-testing
zinigor Oct 23, 2024
4df8ed7
Added transferring of tests.
zinigor Oct 23, 2024
b102738
Added DB password slash escaping.
zinigor Oct 23, 2024
27bbd07
changelog
zinigor Oct 23, 2024
aad27e3
Added a mock for get_option_and_ensure_autoload.
zinigor Oct 23, 2024
9e892e4
Added a missing cache expulsion function.
zinigor Oct 24, 2024
dfb7439
Removed set -x from test installer.
zinigor Oct 24, 2024
bf302d5
Using pnpm to not bother with linking binaries.
zinigor Oct 24, 2024
8f1f194
Added a build step.
zinigor Oct 24, 2024
df0ed81
Merge branch 'trunk' into add/wpcomsh-wpcloud-testing
zinigor Oct 25, 2024
3618211
Created a separate job to avoid re-building on a re-run, h/t @anomiex.
zinigor Oct 25, 2024
510482f
Added cache saving and restoring, moved if to parent job.
zinigor Oct 25, 2024
747555d
Added the before file.
zinigor Oct 25, 2024
cdff320
Trying with instead of .
zinigor Oct 25, 2024
a60df09
Fixing var schema.
zinigor Oct 25, 2024
4f4f451
Merge branch 'trunk' into add/wpcomsh-wpcloud-testing
zinigor Nov 21, 2024
f2ff12f
Merge branch 'trunk' into add/wpcomsh-wpcloud-testing
zinigor Dec 2, 2024
333469a
Merge branch 'trunk' into add/wpcomsh-wpcloud-testing
zinigor Jan 14, 2025
7de6b72
Merge branch 'trunk' into add/wpcomsh-wpcloud-testing
zinigor Jan 15, 2025
3ff1bea
Fixed the user string in SSH connection.
zinigor Jan 15, 2025
131ac21
Trying to create an SSH config file.
zinigor Jan 15, 2025
6b04ffa
Fixed the SSH key file name.
zinigor Jan 15, 2025
738ee0b
Making sure to use the preset configured host.
zinigor Jan 15, 2025
e1dbc3e
Moved the polyfill load to after WordPress loading.
zinigor Jan 15, 2025
88dc9a6
Removed polyfills.
zinigor Jan 17, 2025
6189efa
Merge branch 'trunk' into add/wpcomsh-wpcloud-testing
zinigor Jan 17, 2025
b9de362
Removed null coalescing and added a short ternary.
zinigor Jan 17, 2025
a6b8715
Removed the change detector prop.
zinigor Jan 17, 2025
805d152
Added concurrency settings to make sure there can be only one.
zinigor Jan 17, 2025
e482ee5
Added updating of source files and cleanup after that updating.
zinigor Jan 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 46 additions & 1 deletion .github/workflows/wpcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
build:
name: Install the Monorepo and build wpcomsh
runs-on: ubuntu-latest
outputs:
wpcomsh: ${{ steps.changed.outputs.wpcomsh }}
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -47,17 +49,60 @@ jobs:
- name: Build wpcomsh
if: steps.changed.outputs.wpcomsh == 'true'
run: |
find . -path ./.github -prune -o -type f -print | sort > /tmp/before.txt
echo "::group::Installing and building wpcomsh"
pnpm jetpack build -v --deps plugins/wpcomsh
echo "::endgroup::"

# We only want to save the files that were actually created or changed.
# But we can't just list them for actions/cache/save, "Argument list too long".
# So instead we delete all the unchanged files so we can tell actions/cache/save
# to save everything that's left.
git -c core.quotepath=off diff --name-only | sort > /tmp/changed.txt
if [[ -s /tmp/changed.txt ]]; then
grep -F -x -v -f /tmp/changed.txt /tmp/before.txt > /tmp/remove.txt
else
cp /tmp/before.txt /tmp/remove.txt
fi
xargs -d '\n' rm < /tmp/remove.txt
find . -type d -empty -delete

- name: Save wpcomsh build cache
if: steps.changed.outputs.wpcomsh == 'true'
id: wpcomsh-build-cache-save
uses: actions/cache/save@v4
with:
path: |
.
!./.github/
key: ${{ github.sha }}
deploy:
name: Run PHPUnit on the WPCloud test site
runs-on: ubuntu-latest
needs: build
if: needs.build.changed.outputs.wpcomsh == 'true'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, this is why it skipped this time.

Suggested change
if: needs.build.changed.outputs.wpcomsh == 'true'
if: needs.build.outputs.wpcomsh == 'true'

steps:
- uses: actions/checkout@v4

- name: Restore wpcomsh build cache
id: wpcomsh-build-cache
if: needs.build.result == 'success'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can leave out this line, it's there in the E2E workflow because the build might be skipped when it's going to run against Atomic or something.

Suggested change
if: needs.build.result == 'success'

uses: actions/cache/restore@v4
with:
path: |
.
!./.github/
key: ${{ github.sha }}
fail-on-cache-miss: true

- name: Setup tools
uses: ./.github/actions/tool-setup

- name: Install monorepo
run: |
pnpm install

- name: Configure Github to be able to SSH to the Atomic site
if: needs.build.changed.outputs.wpcomsh == 'true'
run: |
echo "::group::Intializing"

Expand Down
Loading