-
Notifications
You must be signed in to change notification settings - Fork 3
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 #58 from miminashi/56-introduce-testing
テストを導入した
- Loading branch information
Showing
7 changed files
with
100 additions
and
19 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: PreCompile assets | ||
run: ./rails assets:precompile RAILS_ENV=test | ||
- name: Create database | ||
run: ./rails db:create | ||
- name: Run tests on docker compose | ||
run: ./rails test |
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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
3b3af996b321e7ed79a9a85c0a98ef13d079497d28be02d20003a77e6cd65c74d79df4e04a94929de7c797231ffb6f7c9e56745dba6197b955f5a11676356c02 |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
|
||
# SECRET_KEY_BASE が定義されていない場合 | ||
if [ -z "${SECRET_KEY_BASE}" ]; then | ||
echo "SECRET_KEY_BASE is not defined" >&2 | ||
if [ -f secret.txt ]; then | ||
echo "using secret.txt" >&2 | ||
SECRET_KEY_BASE="$(cat secret.txt)" | ||
elif [ -f default_secret.txt ]; then | ||
echo "using default_secret.txt" >&2 | ||
echo "+------------- !!!! WARNING !!!! --------------+" >&2 | ||
echo "| DO NOT USE default_secret.txt FOR DEPLOYMENT |" >&2 | ||
echo "+----------------------------------------------+" >&2 | ||
SECRET_KEY_BASE="$(cat default_secret.txt)" | ||
else | ||
echo "no secret files found" >&2 | ||
exit 1 | ||
fi | ||
fi | ||
|
||
export SECRET_KEY_BASE | ||
docker compose -f docker-compose.yml -f docker-compose-development.yml -p ytdlor "$@" |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
./docker_compose run --rm web rails $@ |
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
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