From bc77ce46acf7010fe43bb64cd14b18733afaad5a Mon Sep 17 00:00:00 2001 From: masa21kik Date: Fri, 4 Oct 2019 14:04:45 +0900 Subject: [PATCH 1/5] add env CI --- .github/workflows/ruby.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 7005d2d..0ab829d 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -18,3 +18,5 @@ jobs: gem install bundler bundle install --jobs 4 --retry 3 bundle exec rake + env: + CI: true From a557a920f58b021e209e9bd55a4f90bc19fe01a1 Mon Sep 17 00:00:00 2001 From: masa21kik Date: Fri, 4 Oct 2019 14:20:00 +0900 Subject: [PATCH 2/5] rm .travis.yml --- .travis.yml | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1268b6e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: ruby -rvm: - - 2.3 - - 2.4 - - 2.5 - - 2.6 -bundler_args: "--jobs=2" -cache: bundler -script: - - bundle exec rspec -stages: - - test - - lint -jobs: - include: - - stage: lint - name: rubocop - rvm: 2.6 - script: bundle exec rubocop -notifications: - email: false - slack: - secure: GLdeVkWryvt5u5b6GZoYppDZ3dGCV9NDNHY6y1+hCjR+MUyTntiRuuhGenoyLt2Im/Yeb4n2/h7ykXHZSwhKYTlmow/4zLtZ7aGBcgaD8EgupdHZWoz0AvEAk/ewm0dblDSWLa6WiMz8U7lh/y2CyjiGz5e1oO9w5LxncbYzCs8= From 945a6d647d8c0762ec3495bbe01dc71132924be0 Mon Sep 17 00:00:00 2001 From: masa21kik Date: Fri, 4 Oct 2019 14:20:33 +0900 Subject: [PATCH 3/5] enable matrix test --- .github/workflows/ruby.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 0ab829d..5cbab23 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -7,12 +7,20 @@ jobs: runs-on: ubuntu-latest + strategy: + matrix: + ruby: + - 2.3.x + - 2.4.x + - 2.5.x + - 2.6.x + steps: - uses: actions/checkout@v1 - - name: Set up Ruby 2.6 + - name: Set up Ruby uses: actions/setup-ruby@v1 with: - ruby-version: 2.6.x + ruby-version: ${{ matrix.ruby }} - name: Build and test with Rake run: | gem install bundler From 6534f9a6e959c3d91607ec84f4f98cce1aca2bf6 Mon Sep 17 00:00:00 2001 From: masa21kik Date: Fri, 4 Oct 2019 15:00:37 +0900 Subject: [PATCH 4/5] add slack notification --- .github/workflows/ruby.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 5cbab23..de663a7 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -28,3 +28,19 @@ jobs: bundle exec rake env: CI: true + + notify: + needs: build + runs-on: ubuntu-latest + + steps: + - name: Slack Notification + uses: homoluctus/slatify@master + if: always() + with: + type: ${{ job.status }} + job_name: '*build*' + mention: 'here' + mention_if: 'failure' + icon_emoji: ":octocat:" + url: ${{ secrets.SLACK_WEBHOOK }} From 810b13f62123917fe4b25dcadde2a178b0309b74 Mon Sep 17 00:00:00 2001 From: masa21kik Date: Fri, 4 Oct 2019 15:20:25 +0900 Subject: [PATCH 5/5] add bundle-update-pr --- .github/workflows/bundle-update-pr.yml | 46 ++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/bundle-update-pr.yml diff --git a/.github/workflows/bundle-update-pr.yml b/.github/workflows/bundle-update-pr.yml new file mode 100644 index 0000000..fd5e1ec --- /dev/null +++ b/.github/workflows/bundle-update-pr.yml @@ -0,0 +1,46 @@ +name: bundle-update-pr + +on: + push: + schedule: + - cron: "00 10 * * 5" # JST 19:00 (Fri) + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + + - name: Set up Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: v2.6.x + + - name: Install dependencies + run: | + set -x + gem install -N bundler circleci-bundle-update-pr + + - name: Set timezone to Asia/Tokyo + run: | + set -x + cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime + + - name: run circleci-bundle-update-pr + run: | + set -x + + export CIRCLE_BRANCH=$(echo $GITHUB_BRANCH | sed -e 's!refs/heads/!!g') + export CIRCLE_PROJECT_USERNAME=$(echo $GITHUB_REPOSITORY | cut -d "/" -f 1) + export CIRCLE_PROJECT_REPONAME=$(echo $GITHUB_REPOSITORY | cut -d "/" -f 2) + + git checkout -b $CIRCLE_BRANCH + + circleci-bundle-update-pr "${GIT_USER_NAME}" "${GIT_USER_EMAIL}" + env: + GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_BRANCH: ${{ github.ref }} + GITHUB_REPOSITORY: ${{ github.repository }} + GIT_USER_NAME: "masa21kik" + GIT_USER_EMAIL: "masa21kik@gmail.com"