0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

GWにやってみたチュートリアルまとめ

Posted at

気になっていたけどやれていなかったチュートリアルをGWにまとめてやってみた。その備忘録。

Summary

キーワード やってみたチュートリアル チュートリアル感想
GitHub Actions GitHub Actions 実践入門 GitHub Actions入門書。技術同人誌の商業版をKindleで購入。GitHub Actionsを使ったCI/CDの方法が一通りわかってすぐ実践できる。
React TypeScript りあクト! TypeScriptで始めるつらくないReact開発 第3.1版【Ⅰ. 言語・環境編】 ReactとTypeScriptの入門書。3部作の第一部で内容はJavaScriptとTypeScriptの説明でまだReactにはたどり着かない。JavaScript、TypeScriptやその周辺技術(webpack等)について、歴史的背景も含めて説明がしてある稀有な一冊。仮にReactを使う予定がなくても、TypeScriptやJavaScriptを使っている人にはおすすめ。

備忘録や感想

GitHub Actions

CI/CDジョブの実行環境

  • ジョブの実行環境として仮想マシンが割り当てられる。UbuntuかWindowsかMacOS。
    • 実行環境としてDockerコンテナが割り当てられるCircleCIよりも自由度が高そう。
  • 仮想マシン上で任意のDockerを立ち上げることも当然できる。
    • LocalStackを使ってAWSをモックしたテストもやりたかったのでこれはありがたい。

実行環境のスペックメモ

アクション内でuname, free, cat /proc/cpuinfo, dfを実行した結果。

pwd; uname -a; free; cat /proc/cpuinfo; df

shell: /usr/bin/bash -e {0}
/home/runner/work/fizz-buzz/fizz-buzz

Linux fv-az47-691 5.4.0-1046-azure #48-Ubuntu SMP Tue Apr 13 07:18:42 UTC 2021 x86_64 x86_64 x86_64 

GNU/Linux
              total        used        free      shared  buff/cache   available
Mem:        7121240      478256     5358028        6564     1284956     6319688
Swap:       4194300           0     4194300

processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 79
model name	: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
stepping	: 1
microcode	: 0xffffffff
cpu MHz		: 2294.686
cache size	: 51200 KB
physical id	: 0
siblings	: 2
core id		: 0
cpu cores	: 2
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 20
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt md_clear
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit
bogomips	: 4589.37
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 79
model name	: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
stepping	: 1
microcode	: 0xffffffff
cpu MHz		: 2294.686
cache size	: 51200 KB
physical id	: 0
siblings	: 2
core id		: 1
cpu cores	: 2
apicid		: 1
initial apicid	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 20
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt md_clear
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit
bogomips	: 4589.37
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:

Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/root       87218124 66596280  20605460  77% /
devtmpfs         3556580        0   3556580   0% /dev
tmpfs            3560620       12   3560608   1% /dev/shm
tmpfs             712124     1048    711076   1% /run
tmpfs               5120        0      5120   0% /run/lock
tmpfs            3560620        0   3560620   0% /sys/fs/cgroup
/dev/loop0         56832    56832         0 100% /snap/core18/1997
/dev/loop1         33152    33152         0 100% /snap/snapd/11588
/dev/loop2         72192    72192         0 100% /snap/lxd/19647
/dev/sda15        106858     7960     98899   8% /boot/efi
/dev/sdb1       14382088  4235296   9396508  32% /mnt

CI/CDジョブの書き方

  • ジョブは複数のアクションとして定義する。アクションは仮想マシン上でのコマンドやスクリプトの実行、そしてGitHubアクションの実行。
  • GitHubアクションはJavaScriptでかけるスクリプト。GitHub上に公開されている公式、非公式のアクションを参照して実行できる。例えば、Nodejsの実行環境をインストールするアクションなどがあって便利に使える。
  • GitHubアクションは自作も可能。他の人も使えるように公開することも、非公開で自分だけで使うことも可能。

感想

Jenkins, CircleCI, GitHub Actionsの中で、一番使いやすそう。Jenkinsとの比較では、やはりマネージであること。CI/CD環境を自前で構築、運用保守はしたくない。CircleCIとの比較では、実行環境がDocker vs 仮想マシン。Dockerの場合、Docker in Dockerを実行するときの制約条件が気になる。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?