-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #136 from koedame/feature/modernize-docker-compose
Migrate to Docker Compose V2
- Loading branch information
Showing
9 changed files
with
272 additions
and
142 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,37 +1,37 @@ | ||
name: Coding Style Check | ||
name: coding-style-check | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
|
||
jobs: | ||
coding-style-check: | ||
standardrb: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Restore Cache | ||
uses: actions/cache@v4 | ||
id: bundle_cache_id | ||
env: | ||
cache-name: cache-bundle | ||
- name: Cache Docker layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./vendor/bundle | ||
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }} | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-gem-${{ env.cache-name }}- | ||
${{ runner.os }}-gem- | ||
${{ runner.os }}- | ||
${{ runner.os }}-buildx- | ||
- name: Install Packages | ||
shell: bash | ||
- name: Install dependencies | ||
run: | | ||
docker compose -f docker-compose.ci.yml run --rm app bundle install --jobs=16 | ||
docker compose -f docker-compose.ci.yml run --rm app bundle clean --force | ||
docker compose -f compose.ci.yml run --rm app bundle install --jobs=16 | ||
docker compose -f compose.ci.yml run --rm app bundle clean --force | ||
- name: Run Linter | ||
run: docker compose -f docker-compose.ci.yml run --rm app bundle exec standardrb | ||
- name: Run standardrb | ||
run: docker compose -f compose.ci.yml run --rm app bundle exec standardrb |
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 |
---|---|---|
@@ -1,47 +1,47 @@ | ||
name: Run Test | ||
name: test | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
|
||
jobs: | ||
run-test: | ||
test: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Restore Cache | ||
uses: actions/cache@v4 | ||
id: bundle_cache_id | ||
env: | ||
cache-name: cache-bundle | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./vendor/bundle | ||
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }} | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-gem-${{ env.cache-name }}- | ||
${{ runner.os }}-gem- | ||
${{ runner.os }}- | ||
${{ runner.os }}-buildx- | ||
- name: Up Docker Container | ||
run: docker compose -f docker-compose.ci.yml up -d | ||
- name: Start containers | ||
run: docker compose -f compose.ci.yml up -d | ||
|
||
- name: Install Packages | ||
shell: bash | ||
- name: Install dependencies | ||
run: | | ||
docker compose -f docker-compose.ci.yml exec app bundle install --jobs=16 | ||
docker compose -f docker-compose.ci.yml exec app bundle clean --force | ||
docker compose -f compose.ci.yml exec app bundle install --jobs=16 | ||
docker compose -f compose.ci.yml exec app bundle clean --force | ||
- name: Setup DB | ||
- name: Setup database | ||
run: | | ||
docker compose -f docker-compose.ci.yml exec app sh -c "cd ./spec/dummy && bundle exec rails db:setup" | ||
docker compose -f compose.ci.yml exec app sh -c "cd ./spec/dummy && bundle exec rails db:setup" | ||
- name: Run Test | ||
run: docker compose -f docker-compose.ci.yml exec app bundle exec rspec | ||
- name: Run tests | ||
run: docker compose -f compose.ci.yml exec app bundle exec rspec | ||
|
||
- name: Down Docker Container | ||
run: docker compose -f docker-compose.ci.yml down | ||
- name: Stop containers | ||
run: docker compose -f compose.ci.yml down |
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 |
---|---|---|
|
@@ -7,3 +7,4 @@ gemspec | |
gem "bump" | ||
gem "rake" | ||
gem "solargraph" | ||
gem "nio4r", "~> 2.7.0" |
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
File renamed without changes.
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
Oops, something went wrong.