upd: reordering steps

This commit is contained in:
Jean-Marie Renouard 2023-03-23 10:39:50 +00:00
parent 8f1abe22b3
commit 0a80fc9d1b
6 changed files with 56 additions and 65 deletions

30
.github/actions/install_db/actions.yml vendored Normal file
View File

@ -0,0 +1,30 @@
runs:
using: "composite"
steps:
- name: Setup MySQL Tuner repository
uses: actions/checkout@v3
- name: Set up MySQL
uses: mirromutth/mysql-action@v1.1
with:
mysql root password: "root"
mysql version: "${{ inputs.MYSQL_VERSION }}"
- name: Injecting credentials
run: |
echo -e "[client]\nuser=root\npassword=root\nhost=127.0.0.1\nprotocol=TCP" > $HOME/.my.cnf
- name: Cloning test_db dataset
run: |
git clone https://github.com/datacharmer/test_db.git
- name: Injecting test_db dataset
run: |
sleep 5s
cd test_db
netstat -ltpn
mysql -e 'select version();'
mysql -e 'CREATE DATABASE data;'
mysql data< ./employees.sql
cd -
rm -rf test_db

View File

@ -0,0 +1,11 @@
runs:
using: "composite"
steps:
- name: Setup MySQL Tuner repository
uses: actions/checkout@v3
- name: Set up MySQL
uses: mirromutth/mysql-action@v1.1
with:
mysql root password: "root"
mysql version: "${{ inputs.MYSQL_VERSION }}"

View File

@ -16,33 +16,10 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Setup MySQL Tuner repository
uses: actions/checkout@v3
- name: Set up MySQL
uses: mirromutth/mysql-action@v1.1
- uses: .github/actions/install_db
with:
mysql root password: "root"
mysql version: "8.0"
- name: Injecting credentials
run: |
echo -e "[client]\nuser=root\npassword=root\nhost=127.0.0.1\nprotocol=TCP" > $HOME/.my.cnf
- name: Cloning test_db dataset
run: |
git clone https://github.com/datacharmer/test_db.git
MYSQL_VERSION: "8.0"
- name: Injecting test_db dataset
run: |
sleep 5s
cd test_db
netstat -ltpn
mysql -e 'select version();'
mysql -e 'CREATE DATABASE data;'
mysql data< ./employees.sql
cd -
rm -rf test_db
# Runs a single command using the runners shell
- name: Run verbose mode with dumpdir result
run: |
@ -50,10 +27,12 @@ jobs:
sudo perl ./mysqltuner.pl --user=root --pass=root --protocol tcp --verbose --dumpdir=./examples/github/result --json | tee -a ./examples/github/result/result.json
# Runs a single command using the runners shell
- name: Commit example result to repo
run: |
git config --global user.name "Jean-Marie Renouard"
git config --global user.email "jmrenouard@gmail.com"
git add .
git commit -m "Commit example result for employees database for Actions"
git push
- name: Run the Action
uses: devops-infra/action-commit-push@master
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
add_timestamp: true
commit_prefix: "[AUTO]"
commit_message: "Updates result examples (via Actions)"
force: false
target_branch: update/version

View File

@ -23,14 +23,9 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Setup MySQL Tuner repository
uses: actions/checkout@v3
- name: Set up MySQL
uses: mirromutth/mysql-action@v1.1
- uses: .github/actions/pull_and_mysql
with:
mysql root password: "root"
mysql version: "8.0"
MYSQL_VERSION: "8.0"
- name: Run help mode
run: |

View File

@ -16,33 +16,10 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Setup MySQL Tuner repository
uses: actions/checkout@v3
- name: Set up MySQL
uses: mirromutth/mysql-action@v1.1
- uses: .github/actions/install_db
with:
mysql root password: "root"
mysql version: "8.0"
- name: Injecting credentials
run: |
echo -e "[client]\nuser=root\npassword=root\nhost=127.0.0.1\nprotocol=TCP" > $HOME/.my.cnf
- name: Cloning test_db dataset
run: |
git clone https://github.com/datacharmer/test_db.git
MYSQL_VERSION: "8.0"
- name: Injecting test_db dataset
run: |
sleep 5s
cd test_db
netstat -ltpn
mysql -e 'select version();'
mysql -e 'CREATE DATABASE data;'
mysql data< ./employees.sql
cd -
rm -rf test_db
# Runs a single command using the runners shell
- name: Run help mode
run: perl ./mysqltuner.pl --help

View File

@ -20,7 +20,6 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Setup MySQL Tuner repository
uses: actions/checkout@v3