Skip to content

Commit

Permalink
Merge pull request #2 from zeriyoshi/ci_overhaul
Browse files Browse the repository at this point in the history
CI Overhaul
  • Loading branch information
taka-oyama authored Oct 19, 2023
2 parents 830ebec + 7712596 commit 36f233a
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 230 deletions.
4 changes: 1 addition & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
/tests export-ignore
.gitattributes export-ignore
.gitignore export-ignore
Dockerfile.test export-ignore
Dockerfile.tidb export-ignore
Dockerfile export-ignore
docker-compose.yml export-ignore
Makefile export-ignore
phpunit.xml export-ignore
wait-for-it.sh export-ignore
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
version: 2
updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "composer"
directory: "/"
schedule:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
uses: actions/checkout@v4
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: Run test with docker compose
run: docker-compose run test
run: docker compose run test
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.env
.idea
.phpunit.result.cache
.phpunit.cache
vendor
composer.lock
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM php:8-cli-alpine

COPY --from=composer:latest "/usr/bin/composer" "/usr/local/bin/composer"

ENV TZ="Asia/Tokyo"

RUN docker-php-ext-install -j$(nproc) "pdo" "pdo_mysql"

COPY ./ "/project"

WORKDIR "/project"
12 changes: 0 additions & 12 deletions Dockerfile.test

This file was deleted.

13 changes: 0 additions & 13 deletions Dockerfile.tidb

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ update:
$(BASE_COMMAND) run test composer update
$(BASE_COMMAND) down --remove-orphans

bash:
sh:
$(BASE_COMMAND) run test /bin/sh

tidb:
Expand Down
18 changes: 18 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '3.4'

services:
test:
build:
context: .
dockerfile: Dockerfile
command: "/bin/sh -c 'composer install && composer exec -- phpunit'"
depends_on:
- tidb
entrypoint: []
volumes:
- .:/project:delegated
tidb:
image: pingcap/tidb:latest
ports:
- "4000:4000"
- "10080:10080"
20 changes: 0 additions & 20 deletions docker-compose.yml

This file was deleted.

178 changes: 0 additions & 178 deletions wait-for-it.sh

This file was deleted.

0 comments on commit 36f233a

Please sign in to comment.