Skip to content

Commit

Permalink
pull in changes from the starter repo
Browse files Browse the repository at this point in the history
  • Loading branch information
jagthedrummer committed Oct 23, 2023
1 parent cd1250b commit 759bac7
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 70 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/_database_schema_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,24 @@ on:
jobs:
check:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11-alpine
ports:
- "5432:5432"
env:
POSTGRES_DB: rails_test
POSTGRES_USER: rails
POSTGRES_PASSWORD: password
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
RAILS_ENV: test
DATABASE_URL: "postgres://rails:password@localhost:5432/rails_test"
BUNDLE_JOBS: 2
BUNDLE_RETRY: 3
steps:
Expand All @@ -24,4 +40,5 @@ jobs:

- name: Database Schema Check
id: db-schema-check
run : bash ./.circleci/db_schema_check
run : ./.circleci/db_schema_check
continue-on-error: false
2 changes: 1 addition & 1 deletion .github/workflows/_reusable_workflows.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is a dummy workflow that's just here to add a bit of organization to the workflow list.
# Too bad they don't allow you to hide workflows or something.
name: " 🚫 |----- Reusable Worflows Below"
name: " 🚫 |----- Reusable Worfklows Below"
on:
workflow_call:

Expand Down
33 changes: 7 additions & 26 deletions .github/workflows/_run_super_scaffolding_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@ on:

jobs:
test:
name: "🏗️"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Set N number of parallel jobs you want to run tests on.
# Use higher number if you have slow tests to split them on more parallel jobs.
# Remember to update ci_node_index below to 0..N-1
ci_node_total: [7]
# set N-1 indexes for parallel jobs
# When you run 2 parallel jobs then first job will have index 0, the second job will have index 1 etc
ci_node_index: [0, 1, 2, 3, 4, 5, 6]
# For super scaffolding tests we need to have exactly 7 runners.
ci_runners: [TestSite, Project, 'Project::Step', Insight, 'Personality::Disposition', 'Personality::Observation', TestFile]
services:
postgres:
image: postgres:11-alpine
Expand Down Expand Up @@ -58,25 +54,10 @@ jobs:
with:
bundler-cache: true

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache yarn cache directory
uses: actions/cache@v3
- uses: actions/setup-node@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Cache node_modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-modules-
node-version-file: .nvmrc
cache: 'yarn'

- name: asset cache
uses: actions/cache@v3
Expand Down Expand Up @@ -107,7 +88,7 @@ jobs:
- name: 'Setup Super Scaffolding System Test'
run: bundle exec test/bin/setup-super-scaffolding-system-test
env:
CIRCLE_NODE_INDEX: ${{ matrix.ci_node_index }}
CIRCLE_NODE_INDEX: ${{ strategy.job-index }}

- name: 'Run Super Scaffolding Test'
run: bundle exec rails test test/system/super_scaffolding_test.rb
Expand Down
37 changes: 10 additions & 27 deletions .github/workflows/_run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@ on:

jobs:
test:
name: "🧪"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Set N number of parallel jobs you want to run tests on.
# Use higher number if you have slow tests to split them on more parallel jobs.
# Remember to update ci_node_index below to 0..N-1
ci_node_total: [7]
# set N-1 indexes for parallel jobs
# When you run 2 parallel jobs then first job will have index 0, the second job will have index 1 etc
ci_node_index: [0, 1, 2, 3, 4, 5, 6]
# Set identifiers for parallel jobs. These can be anything. Just include as many items as you want parallelism.
# For instance if you want a Three Amigos themed pipeline you could use:
# ci_node_index: [Dusty, Ned, Lucky]
ci_runners: [1,2,3,4]
services:
postgres:
image: postgres:11-alpine
Expand Down Expand Up @@ -58,25 +56,10 @@ jobs:
with:
bundler-cache: true

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache yarn cache directory
uses: actions/cache@v3
- uses: actions/setup-node@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Cache node_modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-modules-
node-version-file: .nvmrc
cache: 'yarn'

- name: asset cache
uses: actions/cache@v3
Expand All @@ -102,8 +85,8 @@ jobs:
env:
AUTH_ENDPOINT: https://no-site.nowhere
AWS_REGION: us-east-1
CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
CI_NODE_INDEX: ${{ matrix.ci_node_index }}
CI_NODE_TOTAL: ${{ strategy.job-total }}
CI_NODE_INDEX: ${{ strategy.job-index }}
continue-on-error: false
run : ./bin/parallel-ci
shell: bash
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/ci-cd-pipeline-bt-internal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This workflow will run whenever a PR is opened or changed.
#
# It will run tests and a few safety checks.
#
# If everything passes it can be set to auto-deploy to your staging app on Heroku.
#
# This workflow is primarily meant to be triggered automatically, but it can be run manually.
name: " 🚅 _ BT - Internal CI Pipeline"
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [ "main" ]

jobs:
super_scaffolding:
name: 🏗️ Super Scaffolding Tests
uses: ./.github/workflows/_run_super_scaffolding_tests.yml
secrets: inherit
11 changes: 0 additions & 11 deletions .github/workflows/ci-cd-pipeline-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ jobs:
name: 🧪 MiniTest
uses: ./.github/workflows/_run_tests.yml
secrets: inherit
super_scaffolding:
name: 🏗️ Super Scaffolding Tests
uses: ./.github/workflows/_run_super_scaffolding_tests.yml
secrets: inherit
standardrb:
name: 🔬 Standardrb
uses: ./.github/workflows/_standardrb.yml
Expand All @@ -38,10 +34,3 @@ jobs:
# secrets: inherit
# with:
# heroku-app-name: ""
deploy:
name: 🚢 Deploy to Heroku
uses: ./.github/workflows/_deploy_heroku.yml
needs: [mini_test, super_scaffolding, standardrb, db_schema]
secrets: inherit
with:
heroku-app-name: "bullettrain-co"
4 changes: 0 additions & 4 deletions .github/workflows/ci-cd-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ jobs:
name: 🧪 MiniTest
uses: ./.github/workflows/_run_tests.yml
secrets: inherit
super_scaffolding:
name: 🏗️ Super Scaffolding Tests
uses: ./.github/workflows/_run_super_scaffolding_tests.yml
secrets: inherit
standardrb:
name: 🔬 Standardrb
uses: ./.github/workflows/_standardrb.yml
Expand Down

0 comments on commit 759bac7

Please sign in to comment.