- WORKFLOW_FILE =
'.github/workflows/prs.yml'
"# This file was auto-generated by the schema_dev tool, based on the data in\n# ./schema_dev.yml\n# Please do not edit this file; any changes will be overwritten next time\n# schema_dev gets run.\n"
- BASIC_WORKFLOW =
{
name: 'CI PR Builds',
on: {
push: {
branches: %w[master],
},
pull_request: nil,
},
concurrency: {
group: '${{ github.head_ref }}',
'cancel-in-progress': true,
}
}.freeze
- BASIC_JOB =
{ 'runs-on': 'ubuntu-latest' }.freeze
- BASIC_ENV =
{
BUNDLE_GEMFILE: '${{ github.workspace }}/gemfiles/activerecord-${{ matrix.activerecord }}/Gemfile.${{ matrix.db }}'
}.freeze
- FINISH_STEPS =
[
{
name: 'Coveralls Finished',
if: '${{ !env.ACT }}',
uses: 'coverallsapp/github-action@master',
with: {
'github-token': '${{ secrets.GITHUB_TOKEN }}',
'parallel-finished': true,
}
}
].freeze
- STEPS =
{
start: [
{
uses: 'actions/checkout@v2',
},
{
name: 'Set up Ruby',
uses: 'ruby/setup-ruby@v1',
with: {
'ruby-version': '${{ matrix.ruby }}',
'bundler-cache': true,
},
},
{
name: 'Run bundle update',
run: 'bundle update',
},
],
test: [
{
name: 'Run tests',
run: 'bundle exec rake spec',
}
],
finish: [
{
name: 'Coveralls Parallel',
if: '${{ !env.ACT }}',
uses: 'coverallsapp/github-action@master',
with: {
'github-token': '${{ secrets.GITHUB_TOKEN }}',
'flag-name': 'run-${{ matrix.ruby }}-${{ matrix.activerecord }}-${{ matrix.db }}-${{ matrix.dbversion }}',
parallel: true,
}
}
],
}.freeze
- DB_ENV =
{
postgresql: {
POSTGRESQL_DB_HOST: '127.0.0.1',
POSTGRESQL_DB_USER: 'schema_plus_test',
POSTGRESQL_DB_PASS: 'database',
},
mysql2: {
MYSQL_DB_HOST: '127.0.0.1',
MYSQL_DB_USER: 'root',
MYSQL_DB_PASS: 'database',
},
}.freeze
- DB_STARTUP =
{
postgresql: [
{
name: 'Start Postgresql',
if: "matrix.db == 'postgresql'",
run: " docker run --rm --detach \\\\\n -e POSTGRES_USER=$POSTGRESQL_DB_USER \\\\\n -e POSTGRES_PASSWORD=$POSTGRESQL_DB_PASS \\\\\n -p 5432:5432 \\\\\n --health-cmd \"pg_isready -q\" \\\\\n --health-interval 5s \\\\\n --health-timeout 5s \\\\\n --health-retries 5 \\\\\n --name database postgres:${{ matrix.dbversion }}\n BASH\n },\n ],\n mysql2: [\n {\n name: 'Start Mysql',\n if: \"matrix.db == 'mysql2'\",\n run: <<~BASH\n docker run --rm --detach \\\\\n -e MYSQL_ROOT_PASSWORD=$MYSQL_DB_PASS \\\\\n -p 3306:3306 \\\\\n --health-cmd \"mysqladmin ping --host=127.0.0.1 --password=$MYSQL_DB_PASS --silent\" \\\\\n --health-interval 5s \\\\\n --health-timeout 5s \\\\\n --health-retries 5 \\\\\n --name database mysql:5.6\n BASH\n }\n ],\n}.freeze\n"
- DB_SETUP_NEEDED =
%w[postgresql mysql2].freeze
- DB_SETUP =
[
{
name: 'Wait for database to start',
if: "(matrix.db == 'postgresql' || matrix.db == 'mysql2')",
run: " COUNT=0\n ATTEMPTS=20\n until [[ $COUNT -eq $ATTEMPTS ]]; do\n [ \"$(docker inspect -f {{.State.Health.Status}} database)\" == \"healthy\" ] && break\n echo $(( COUNT++ )) > /dev/null\n sleep 2\n done\n BASH\n },\n {\n name: 'Create testing database',\n if: \"(matrix.db == 'postgresql' || matrix.db == 'mysql2')\",\n run: 'bundle exec rake create_ci_database',\n },\n].freeze\n"
- DB_TEARDOWN_NEEDED =
%w[postgresql mysql2].freeze
- DB_TEARDOWN =
[
{
name: 'Shutdown database',
if: "always() && (matrix.db == 'postgresql' || matrix.db == 'mysql2')",
run: 'docker stop database',
}
].freeze