DEV Community

voluntas
voluntas

Posted on

1 3

GitHub Actions で自前ビルド Erlang/OTP を利用する

GitHub Actions で自前ビルドの Erlang/OTP を利用する場合は Docker Hub 経由がおすすめです。いろいろ試してみて最小限の yml ができたので公開しておきます。

yml ファイル

name: make-github-workflow

on:
  push:
    paths-ignore:
    - 'doc/**'
    - '**.rst'
  pull_request:

jobs:
  make-github:
    runs-on: ubuntu-latest
    container:
      image: shiguredo/erlang:otp-23.0-rc2-ubuntu-18.04
    steps:
      - uses: actions/checkout@v2
      - run: make github
      - name: Slack Notification
        if: failure()
        uses: rtCamp/action-slack-notify@v2.0.1
        env:
          SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
Enter fullscreen mode Exit fullscreen mode

簡単な解説

runs-osubuntu-latest をおすすめします、この上で docker を起動して動かします。

container.image で利用する docker コンテナのイメージが指定できます、ここでは時雨堂が独自ビルドしている Erlang/OTP 23.0-rc2 on Ubuntu 18.04 のイメージを利用しています。

Docker Hub
https://hub.docker.com/r/shiguredo/erlang

GitHub
https://github.com/shiguredo/dockerfiles/tree/master/erlang

失敗したときのみ Slack 経由で通知するようにしています。 if: failure() がその部分です。

未確認

  • rebar3 deps + GitHub プライベートレポジトリが ssh-agent を利用してもうまく動きません
  • ビルドに失敗し、その後成功したときのみ通知する fixed の実現方法がわかりません
  • secrets がリポジトリごとではなく組織単位で共通化する方法がわかりません
  • 複数の OTP での検証をする場合は色々ややこしそうです

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay