Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
GitHub Actions使ってみた
Search
Takeo Fujita
January 15, 2020
Programming
1
69
GitHub Actions使ってみた
2020-01-15のShibuya.rbで話した資料です
Takeo Fujita
January 15, 2020
Tweet
Share
More Decks by Takeo Fujita
See All by Takeo Fujita
refinementsを使ってみた話
tkeo
0
270
IRKitで遊んでみた
tkeo
0
2.8k
Other Decks in Programming
See All in Programming
The Modern View Layer Rails Deserves: A Vision For 2025 And Beyond @ RailsConf 2025, Philadelphia, PA
marcoroth
2
670
ペアプロ × 生成AI 現場での実践と課題について / generative-ai-in-pair-programming
codmoninc
2
20k
Modern Angular with Signals and Signal Store:New Rules for Your Architecture @enterJS Advanced Angular Day 2025
manfredsteyer
PRO
0
240
VS Code Update for GitHub Copilot
74th
2
670
Webの外へ飛び出せ NativePHPが切り拓くPHPの未来
takuyakatsusa
2
580
脱Riverpod?fqueryで考える、TanStack Queryライクなアーキテクチャの可能性
ostk0069
0
340
Google Agent Development Kit でLINE Botを作ってみた
ymd65536
2
260
猫と暮らす Google Nest Cam生活🐈 / WebRTC with Google Nest Cam
yutailang0119
0
160
Goで作る、開発・CI環境
sin392
0
260
What's new in AppKit on macOS 26
1024jp
0
140
フロントエンドのパフォーマンスチューニング
koukimiura
5
1.8k
PHP 8.4の新機能「プロパティフック」から学ぶオブジェクト指向設計とリスコフの置換原則
kentaroutakeda
2
1k
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
The Invisible Side of Design
smashingmag
301
51k
Producing Creativity
orderedlist
PRO
346
40k
The Pragmatic Product Professional
lauravandoore
35
6.7k
Building Adaptive Systems
keathley
43
2.7k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
Practical Orchestrator
shlominoach
189
11k
GraphQLとの向き合い方2022年版
quramy
49
14k
The Straight Up "How To Draw Better" Workshop
denniskardys
235
140k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
Transcript
(JU)VC"DUJPOT ͬͯΈͨ ULFP!HSJNPJSF
ࠓճͷ༰ w SVCZ SBJMTͷϓϩδΣΫτͰ w (JU)VC"DUJPOT্ͰSTQFDͱSVCPDPQΛ࣮ߦ͢ΔΑ͏ʹ ͨ͠ઃఆʹ͍ͭͯ͠·͢
STQFDઃఆ name: rspec on: [push] jobs: rspec: runs-on: ubuntu-latest
services: mysql: image: mysql:5.7 ports: - 3306 env: MYSQL_ROOT_PASSWORD: password options: --health-cmd "mysqladmin ping -h localhost" --health- interval 20s --health-timeout 10s --health-retries 10 steps: ...
STQFDઃఆ name: rspec on: [push] jobs: rspec: runs-on: ubuntu-latest
services: mysql: image: mysql:5.7 ports: - 3306 env: MYSQL_ROOT_PASSWORD: password options: --health-cmd "mysqladmin ping -h localhost" --health- interval 20s --health-timeout 10s --health-retries 10 steps: ... ͩͱμϝͩͬͨ ผͷNZTRME͕ಈ͍͍ͯΔʁ Error response from daemon: driver failed programming external connectivity on endpoint ba63e7e68566491db14827f2d1adb41a_mysql57_a09e79 (9a3741b40cb203da75dd3a74c7a08f04296856b0a7ded0509f809d2af68075d2): Error starting userland proxy: listen tcp 0.0.0.0:3306: bind: address already in use
STQFDઃఆ steps: - uses: actions/checkout@v1 # チェックアウト - name:
setup ruby # rubyのセットアップ uses: actions/setup-ruby@v1 with: ruby-version: 2.5.x - name: install libraries # 依存ライブラリをインストール run: | sudo apt update || : sudo apt install -y --no-install-recommends libmysqlclient-dev - uses: actions/cache@v1 # キャッシュ読み込み with: path: vendor/bundle key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }} restore-keys: | ${{ runner.os }}-gem- - name: bundle install # bundle install run: | gem install bundler bundle install --jobs=4 --retry=3 --path=vendor/bundle
STQFDઃఆ steps: - uses: actions/checkout@v1 # チェックアウト - name:
setup ruby # rubyのセットアップ uses: actions/setup-ruby@v1 with: ruby-version: 2.5.x - name: install libraries # 依存ライブラリをインストール run: | sudo apt update || : sudo apt install -y --no-install-recommends libmysqlclient-dev - uses: actions/cache@v1 # キャッシュ読み込み with: path: vendor/bundle key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }} restore-keys: | ${{ runner.os }}-gem- - name: bundle install # bundle install run: | gem install bundler bundle install --jobs=4 --retry=3 --path=vendor/bundle ͨͼͨͼΤϥʔ͕ى͜ΔͷͰແࢹ͢Δ SVCZKQͰڭ͑ͯΒͬͨ Ωϟογϡ͍ͨ͠ͷͰ ύεΛࢦఆ͢Δ
STQFDઃఆ - name: setup database # DB作成 run: |
cp config/database.yml.ci config/database.yml bundle exec rails db:setup env: MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }} MYSQL_ROOT_PASSWORD: password RAILS_ENV: test - name: run rspec # rspec実行 run: bundle exec rspec env: MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }} MYSQL_ROOT_PASSWORD: password RAILS_ENV: test - name: slack notification # 失敗時にslackへ通知 uses: 8398a7/
[email protected]
with: author_name: rspec result status: ${{ job.status }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} if: failure()
STQFDઃఆ - name: setup database # DB作成 run: |
cp config/database.yml.ci config/database.yml bundle exec rails db:setup env: MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }} MYSQL_ROOT_PASSWORD: password RAILS_ENV: test - name: run rspec # rspec実行 run: bundle exec rspec env: MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }} MYSQL_ROOT_PASSWORD: password RAILS_ENV: test - name: slack notification # 失敗時にslackへ通知 uses: 8398a7/
[email protected]
with: author_name: rspec result status: ${{ job.status }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} if: failure() ϦϙδτϦͷ 4FUUJOHT4FDSFUT Ͱઃఆ͢Δ ࣗಈͰׂΓͯΒΕͨ ϙʔτΛ༻ ࣗಈͰઃఆ
EBUBCBTFZNMDJ test: adapter: mysql2 encoding: utf8mb4 pool: <%= ENV.fetch("RAILS_MAX_THREADS") {
5 } %> host: 127.0.0.1 port: <%= ENV["MYSQL_PORT"] %> database: app_test username: root password: <%= ENV["MYSQL_ROOT_PASSWORD"] %>
EBUBCBTFZNMDJ test: adapter: mysql2 encoding: utf8mb4 pool: <%= ENV.fetch("RAILS_MAX_THREADS") {
5 } %> host: 127.0.0.1 port: <%= ENV["MYSQL_PORT"] %> database: app_test username: root password: <%= ENV["MYSQL_ROOT_PASSWORD"] %> MPDBMIPTUͩͱμϝͩͬͨ Mysql2::Error::ConnectionError: Access denied for user 'root'@'localhost' (using password: YES)
SVCPDPQ w SFWJFXEPHΛར༻ͯ͠ɺՕॴΛࢦఠ͢Δܗʹͨ͠ w NBSLFUQMBDFͰSVCPDPQ༻ͷBDUJPO͕͍͔ͭ͘ެ։͞Ε ͍ͯΔ͕͕͋Γෆ࠾༻ w όʔδϣϯࢦఆ͕Ͱ͖ͣ࠷৽͕ೖΔ w SVCPDPQQFSGPSNBODFͱ͔ՃͷHFN͕ೖΒͳ͍
w ͳͲ
SVCPDPQઃఆ name: rubocop on: [push] jobs: rubocop: runs-on: ubuntu-latest
steps: - uses: actions/checkout@v1 # チェックアウト - name: setup ruby uses: actions/setup-ruby@v1 # rubyのセットアップ with: ruby-version: 2.5.x - name: install libraries # 依存ライブラリをインストール run: | sudo apt update || : sudo apt install -y --no-install-recommends libmysqlclient-dev
SVCPDPQઃఆ - uses: actions/cache@v1 # キャッシュ読み込み with: path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }} restore-keys: | ${{ runner.os }}-gem- - name: bundle install # bundle install run: | gem install bundler bundle install --jobs=4 --retry=3 --path=vendor/bundle - name: install reviewdog # reviewdogをインストール run: | curl https://raw.githubusercontent.com/reviewdog/reviewdog/master/ install.sh | sh -s -- $REVIEWDOG_VERSION env: REVIEWDOG_VERSION: v0.9.14
SVCPDPQઃఆ - name: run rubocop # rubocopを実行 run: |
bundle exec rubocop --parallel | ./bin/reviewdog -f=rubocop - reporter=github-check env: REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: slack notification # 失敗時にslackへ通知 uses: 8398a7/
[email protected]
with: author_name: rubocop result status: ${{ job.status }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} if: failure()
None