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
71
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
組込みだけじゃない!TinyGo で始める無料クラウド開発入門
otakakot
0
150
『毎日の移動』を支えるGoバックエンド内製開発
yutautsugi
2
220
Pull-Requestの内容を1クリックで動作確認可能にするワークフロー
natmark
2
480
Swift Concurrency - 状態監視の罠
objectiveaudio
2
490
(Extension DC 2025) Actor境界を越える技術
teamhimeh
1
250
私はどうやって技術力を上げたのか
yusukebe
43
18k
Django Ninja による API 開発効率化とリプレースの実践
kashewnuts
0
1.2k
Web フロントエンドエンジニアに開かれる AI Agent プロダクト開発 - Vercel AI SDK を観察して AI Agent と仲良くなろう! #FEC余熱NIGHT
izumin5210
3
480
なぜあの開発者はDevRelに伴走し続けるのか / Why Does That Developer Keep Running Alongside DevRel?
nrslib
3
390
overlayPreferenceValue で実現する ピュア SwiftUI な AdMob ネイティブ広告
uhucream
0
170
CSC509 Lecture 05
javiergs
PRO
0
300
Things You Thought You Didn’t Need To Care About That Have a Big Impact On Your Job
hollycummins
0
210
Featured
See All Featured
Writing Fast Ruby
sferik
629
62k
Building Adaptive Systems
keathley
43
2.8k
How GitHub (no longer) Works
holman
315
140k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
2.7k
Being A Developer After 40
akosma
91
590k
Documentation Writing (for coders)
carmenintech
75
5k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
32
2.3k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Building Better People: How to give real-time feedback that sticks.
wjessup
368
20k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
900
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