GitHub Actions (CI)に関して色々まとめる場所 (YAML版)
#GitHub #GitHub_Actions #CI
https://gyazo.com/2323934cd3685e1f748c7125f1964b8d
2019/8/9 の朝に話題になっていたGitHub Actionsについて。そのだいぶ前からbetaはあった。
いろんなOSのCIができそうになってる
Linux, macOS WIndows
YAMLでplatform: [ubuntu-latest, macos-latest, windows-latest]などが指定できる
記法はYAML
以前は.workflowという拡張子でHCLという記法だった
マイグレーションツールを公式が用意してくれてる
Migrating GitHub Actions from HCL syntax to YAML syntax - GitHub Help
matrixが使える
Travis CIなどにもあったもの。
簡単な理解では、一つの変数対して複数値で動かしたいときに便利
例1: ${{ matrix.platform }}の部分は[ubuntu-latest, macos-latest, windows-latest]のそれぞれが展開されるように実行されると思われる。
code:ci.yml
on: push
jobs:
test:
strategy:
matrix:
platform: ubuntu-latest, macos-latest, windows-latest
runs-on: ${{ matrix.platform }}
例2: 以下だと複数のOSバージョンと複数のNode.jsバージョンを
code:yml
strategy:
matrix:
node: 6, 8, 10
os: ubuntu-14.04, ubuntu-18.04
導入事例
Piping Server: https://github.com/nwtgck/piping-server/blob/develop/.github/workflows/ci.yml
CI status: https://github.com/nwtgck/piping-server/runs/194316678