diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ad625be..f5fc008 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,6 @@ name: CI -on: [push] +on: [pull_request] jobs: build: @@ -10,7 +10,6 @@ jobs: image: utyosu/build-rails:latest steps: - - run: | - BRANCH_NAME=`echo "${GITHUB_REF}" | sed "s/^\(refs\/heads\/\|refs\/remotes\/\)//"` - echo ${BRANCH_NAME} - /app/run.sh https://github.com/${GITHUB_REPOSITORY}.git ${BRANCH_NAME} tools/cloud_build/test.sh + - uses: actions/checkout@master + - name: run test + run: . tools/cloud_build/test.sh diff --git a/tools/cloud_build/Dockerfile b/tools/cloud_build/Dockerfile index 8391984..f5c6b4b 100644 --- a/tools/cloud_build/Dockerfile +++ b/tools/cloud_build/Dockerfile @@ -5,9 +5,10 @@ FROM ubuntu:16.04 SHELL ["/bin/bash", "-c"] -ENV DEBIAN_FRONTEND="noninteractive" ENV RUBY_VERSION="2.5.1" ENV BUNDLER_VERSION="2.1.4" +ENV DEBIAN_FRONTEND="noninteractive" +ENV PATH=/root/.rbenv/bin:/root/.rbenv/shims:$PATH WORKDIR /app @@ -39,5 +40,3 @@ RUN set -x \ && /root/.rbenv/shims/bundle config set without development \ && /root/.rbenv/shims/bundle install \ && rm Gemfile Gemfile.lock - -COPY /tools/cloud_build/run.sh . diff --git a/tools/cloud_build/run.sh b/tools/cloud_build/run.sh deleted file mode 100644 index 916b654..0000000 --- a/tools/cloud_build/run.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# Rubyにパスを通す -export PATH="/root/.rbenv/bin:/root/.rbenv/shims:$PATH" - -# Dockerfileがマルチレイヤのとき、MySQLを起動する前に以下コマンドの実行が必要 -find /var/lib/mysql -type f -exec touch {} \; - -REPOSITORY=${1} -BRANCH=${2} -SCRIPT_PATH=${3} - -mkdir repository -git clone -b ${BRANCH} ${REPOSITORY} repository -cd repository - -. ${SCRIPT_PATH}