tldr,
Github ActionsではmacOSでCIを回すことができるので、dotfileなどのセットアップスクリプトをCIするのに使える
思いつき
この記事に触発されて自分のもやってみた
https://itchyny.hatenablog.com/entry/2019/11/18/120000
僕のdotfileは以下
https://github.com/nozo-moto/dotfiles/
Github Actionsの設定
workflowはこんな感じ
name: CI
on: [push]
jobs:
build:
runs-on: macos
steps:
- name: Checkout Code
uses: actions/checkout@v1
- name: install
run: ./install.sh
Github ActionsではMacOSを使えるのでそれを使う
https://help.github.com/ja/actions/automating-your-workflow-with-github-actions/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources
また、実行時間が最大6時間まで動かせるので多少ビルドに時間かかるようなものでも動かすことができそう
https://help.github.com/ja/actions/automating-your-workflow-with-github-actions/about-github-actions#about-billing-for–sitedatavariablesproductprodname_actions-
動作をみてるとGithub ActionsのmacOSには xcodeとHomeBrewが入っている気がする
install.sh の設定
BrewfileでHomeBrewでいれてるパッケージを導入している
#!/bin/bash
#install package maneger{{{
if [ "$(uname)" == 'Darwin' ]; then
xcode-select --install > /dev/null
if ! builtin command -v brew > /dev/null; then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
brew bundle
fi
# あとはdotfileのシンボリックリンクを貼ったりしてる
終わり
GithubActions便利