-
Notifications
You must be signed in to change notification settings - Fork 550
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
GitHub Actions: Add macOS cases. #1170
Conversation
|
||
# Install the default used DB if DB is not set. | ||
if [[ -n ${GITHUB_ACTION-} && -z ${DB-} ]]; then | ||
if [[ -n ${GITHUB_ACTIONS-} && -z ${DB-} ]]; then |
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 renamed the environment variable
GITHUB_ACTION
toGITHUB_ACTIONS
. I think theGITHUB_ACTIONS
showing alwaystrue
on GitHub Actions environment is a right environment variable, and what I wanted to use. See https://docs.github.com/en/actions/reference/environment-variables .
# where ALTER USER is not available. | ||
# https://stackoverflow.com/questions/56052177/ | ||
CHANGED_PWD_BY_RECREATE=false | ||
CHANGED_PASSWORD_BY_RECREATE=false |
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 renamed
CHANGED_PWD
toCHANGED_PASSWORD
, becausePWD
makes me imaginepwd
(print working directory) command. Sorry it was my typo.
fi | ||
|
||
# IF NOT EXISTS is mariadb-10+ only - https://mariadb.com/kb/en/mariadb/comment-syntax/ | ||
mysql -u root -e 'CREATE DATABASE /*M!50701 IF NOT EXISTS */ test' |
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.
The new macOS db: '[email protected]'
case showed the error when running mysql -u root -e 'CREATE DATABASE /*M!50701 IF NOT EXISTS */ test'
, because it was recognized as mysql -u root -e 'CREATE DATABASE test'
and there was test
database already. As every used database supports IF NOT EXISTS
in CIs, I think we can remove the /*M!50701 ... */
.
bd0e982
to
0f50311
Compare
The CIs are okay for both GitHub Actions and Travis CI. I noticed the "Checks" tab showing the result of GitHub Actions. It looks convenient. |
I added one more commit for the review. Now MariaDB 10.5 (10.5.9) and MySQL 8.0 (8.0.23) are set on the macOS cases. I removed the
|
95a12a5
to
a0a9a62
Compare
I did split the previous 2 commits to 4 commits, splitting the previous 1st commit about migrating macOS and renaming variables. I think it's better to see the commit about migrating macOS. The CIs looks okay. (Travis log on my forked repository). |
GITHUB_ACTIONS showing always true on GitHub Actions environment is a right environment variable See https://docs.github.com/en/actions/reference/environment-variables .
It's better to know the meaning.
* Migrate macOS cases in Travis to GitHub Actions. * Increase the expected time in the test to avoid the following random failures on macOS. ``` 1) Mysql2::Client#query threaded queries should be supported Failure/Error: expect(stop - start).to be_within(0.1).of(sleep_time) expected 0.632204999999999 to be within 0.1 of 0.5 # ./spec/mysql2/client_spec.rb:711:in `block (3 levels) in <top (required)>' ``` ``` 3) Mysql2::Client#query should run signal handlers while waiting for a response Failure/Error: expect(mark.fetch(:QUERY_END) - mark.fetch(:QUERY_START)).to be_within(0.1).of(query_time) expected 1.1042130000000157 to be within 0.1 of 1.0 # ./spec/mysql2/client_spec.rb:632:in `block (3 levels) in <top (required)>' ```
a0a9a62
to
6bc631b
Compare
Looks good! |
Migrate macOS cases in Travis to GitHub Actions.
Increase the expected time in the test to avoid the following random failures
on macOS.
Notes
I renamed
.github/workflows/ubuntu.yml
tobuild.yml
again, after adding the macOS cases to the file. I considered the nameubuntu_macos.yml
. But thinking about we want to keep a same name for a long time, and considering the name (name: Build
) is used as a build badge name when we will add it later. The nameBuild
makes sense to me.In Travis macOS case, the brew package
mariadb-connector-c
was installed. So I always installed themariadb-connector-c
in GitHub Actions macOS case too. However when we do not actually install it on thedb: '[email protected]'
case of the macOS,rake compile
can be compiled, and there are some test failures. Indb: '[email protected]'
case,rake compile
shows the following library missing error whenmariadb-connector-c
is not installed.We might be able to install
mariadb-connector-c
conditionally on macOS case like this.