-
Notifications
You must be signed in to change notification settings - Fork 3
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
[CMSP-726] switch to gha #116
Merged
Merged
Changes from all commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
e618fe7
add a test workflow
jazzsequence d00680d
also run on release
jazzsequence 35969e1
add git config
jazzsequence 3ef4cd8
add the docker-updatinator image
jazzsequence ea7fa5e
use v2 checkout(?)
jazzsequence 49830c7
add write permissions to the bot
jazzsequence 6af6458
run as root
jazzsequence 9351ede
add an ssh key to authenticate for whoami test
jazzsequence 4ce6e8b
login to github with the right token
jazzsequence 4f36935
remove quay container and just use gh
jazzsequence 4b3a89c
set auth token perms to read all
jazzsequence ce5b3a4
remove permissions entirely
jazzsequence b9f34ee
re-add write permissions
jazzsequence b1f8cd7
move the git config higher and output the status to see if we can fig…
jazzsequence 518f804
export the gh token
jazzsequence 5ab9af1
unset the existing GITHUB_TOKEN before using ours
jazzsequence f0a0795
make it a separate step
jazzsequence 25e9a87
also unset and export GH_TOKEN
jazzsequence c379e14
use the actual token rather than variable we exported
jazzsequence 30e023f
allow ssh for debugging
jazzsequence f4a3dbd
move tmate to after failing test
jazzsequence 8746cb2
allow other users to ssh in
jazzsequence 34d9898
maybe switching to false will actually let us log in?
jazzsequence 2a214b7
try not running whoami
jazzsequence 6648552
I guess put stuff in here since we committed it to vc
jazzsequence ca600d6
add unset to the regular script
jazzsequence 778291a
remove typo
jazzsequence e4f5541
remove --with-token
jazzsequence 490a02a
set tokens as env variables in the job
jazzsequence 495fe38
remove tmate
jazzsequence 895c323
add tokens to test steps, too
jazzsequence 837efa1
unset tokens again
jazzsequence 52f9b1b
maybe don't need to auth?
jazzsequence 21c69b6
okay, let's whoami with this token
jazzsequence 4565625
use php 7.4
jazzsequence 6fdcc9a
install php 7.4 earlier
jazzsequence c3f3344
add mariadb for wp tests
jazzsequence 14092ca
add custom db name
jazzsequence e7d0333
define empty password for root user
jazzsequence 176c60a
use the updatinator container
jazzsequence e7b85c1
grant write permissiosn
jazzsequence 2067099
use container as root
jazzsequence 6698fc2
pass env variables into the test step
jazzsequence 94d64d4
install wp-cli
jazzsequence 9a090fa
remove the root password since it's not part of the fixture
jazzsequence 1162edb
test the database
jazzsequence a6efc26
set root password to empty
jazzsequence 75006c2
try connecting with root password
jazzsequence 9330efb
set password to empty string
jazzsequence 221618e
more database setup
jazzsequence d87bb7b
change how we set the password
jazzsequence ee65a9d
don't use PASSWORD()
jazzsequence 885ab34
remove the password for the blank password test
jazzsequence 0ad2c15
don't create the database
jazzsequence b2c7740
remove test workflow since it's converted to gha
jazzsequence 1b70853
rename deploy to publish
jazzsequence 70840a3
set test to run on tag creation rather than release creation
jazzsequence f2f2b0a
send dispatch so releases are chained from tests
jazzsequence 4a6e65d
change the trigger to repository_dispatch
jazzsequence 1d38e2e
change the job name to publish
jazzsequence 556652e
setup php
jazzsequence 2d321ae
get the tag name that was just created
jazzsequence 8a4dd25
publish the release
jazzsequence 073dc12
build the update-tool.phar
jazzsequence ceeec7e
upload the phar to the release
jazzsequence 8faf239
delete circle workflow
jazzsequence 9c10528
Use GitHub test badge
jazzsequence 720a3f0
update notes
jazzsequence 2ef12aa
use checkout@v3
jazzsequence 4939fef
use a non-deprecated release action
jazzsequence a6d63cc
one does not simply create a new tag
jazzsequence File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Deploy | ||
on: | ||
repository_dispatch: | ||
types: [tests-passed] | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
- name: Get tag name | ||
id: tag_name | ||
run: echo ::set-output name=tag::${GITHUB_REF#refs/tags/} | ||
- name: Build phar | ||
run: | | ||
composer install | ||
composer phar:build | ||
- name: Publish Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: 'update-tool.phar' | ||
artifactErrorsFailBuild: true | ||
body: Version ${{ steps.tag_name.outputs.tag }} | ||
generateReleaseNotes: true | ||
makeLatest: true |
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,76 @@ | ||
name: Test | ||
on: | ||
pull_request: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
permissions: write-all | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
services: | ||
mariadb: | ||
image: mariadb:10.5 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set PHP version | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.4 | ||
- name: Setup MySQL | ||
run: | | ||
sudo systemctl start mysql | ||
mysqladmin -h 127.0.0.1 -u root -proot status | ||
echo "Setting the root password to empty" | ||
mysql -h 127.0.0.1 -u root -proot -e "USE mysql; UPDATE user SET authentication_string='' WHERE User='root'; FLUSH PRIVILEGES;" | ||
echo "Testing blank password" | ||
mysqladmin -h 127.0.0.1 -u root status | ||
- name: Install Composer Dependencies | ||
run: composer install --prefer-dist --no-progress --no-suggest | ||
- name: Install SSH key | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.PANTHEON_UPSTREAM_SSH_KEY }} | ||
- name: Unset GitHub Tokens | ||
shell: bash | ||
run: | | ||
unset GITHUB_TOKEN | ||
unset GH_TOKEN | ||
- name: Run Update Tool Whoami | ||
shell: bash | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PANTHEON_UPSTREAM_AUTH_TOKEN }} | ||
GH_TOKEN: ${{ secrets.PANTHEON_UPSTREAM_AUTH_TOKEN }} | ||
run: | | ||
echo "Set git config" | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Pantheon Automation" | ||
echo "Login with gh auth" | ||
# gh auth login | ||
gh auth status | ||
./update-tool whoami | ||
- name: Install WP-CLI | ||
run: | | ||
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | ||
chmod +x wp-cli.phar | ||
sudo mv wp-cli.phar /usr/local/bin/wp | ||
wp --info | ||
- name: Run tests | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PANTHEON_UPSTREAM_AUTH_TOKEN }} | ||
GH_TOKEN: ${{ secrets.PANTHEON_UPSTREAM_AUTH_TOKEN }} | ||
DB_USER: root | ||
DB_NAME: updatinate-wp-db | ||
run: composer test | ||
send-dispatch: | ||
if: startsWith(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Send Dispatch | ||
uses: peter-evans/repository-dispatch@v1 | ||
with: | ||
token: ${{ secrets.PANTHEON_UPSTREAM_AUTH_TOKEN }} | ||
repository: pantheon-systems/update-tool | ||
event-type: tests-passed |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebuild where/how? Rebuild in github? Rebuild in Quay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe so. This was copy/pasta from the original notes.