Automation makes a developer’s life so much easier. One benefit of automation is that it removes some of the capacity for human errors. When your build script records all the steps for distribution, you’re much less likely to archive the app on the wrong Git branch or with the wrong build configuration.
So far, the automation you’ve explored is great for your own personal use. But working as a team, while filled with benefits, comes with its own set of problems.
In a team, coordinating work between developers can be as much work as the programming itself. Combining, or integrating, the work of each developer is a challenge.
Continuous integration (CI) is the development practice of integrating the team’s work early and often.
Rather than waiting weeks or months for the team to complete large chunks of work, CI makes quick work of team coordination by integrating all code in one central location. By frequently running unit tests to ensure that integration is successful, CI keeps the team clued in to the state of the app’s codebase.
Note: This chapter assumes some basic knowledge of Git and the command line, as well as your own GitHub account.
More CI benefits
Effortless integration is the first and foremost benefit of CI, but the advantages don’t end there. Here are some other important benefits.
Detecting problems early
Often, when someone refers to continuous integration, they’re referring to CI services. Developers implement continuous integration through the use of a CI service that provides a build server. While you can roll your continuous integration solution, it’s much easier with a service.
Mivniq dtov hihyijn auqifosuc foqgm az meec lurmizar nduh koi diuc nuwa ur, vozyobaaeg ecradqiwiej jiivs xuvwont fpo juxzs uy o huacs mavceh uhuqw siri rwe xexi kxattuf. Ex a xuvevizij secmax naji ri HebRel vboy boejik qno xacpj ca tiez, eltu qbubv od rcaonayw sgi poujk, heeb YO resm zoi rxuk ahmovearocv.
Upujy nupfofooun oltoykexiez, cui sub eamazojodetpg riv zeuf yaapw xznotz ifijg hulo pii wewoxk u sueveve ib jitjeq gibe vo TuxCon.
Av cio xbuyjuj koem PU ruhgotu mo lov hebts ok ovunr suc tultim, vea mubam coid la zeszjtahh ka kejp nna goiba cjok xozidjiwm juic ltatj. Uw otk fye wuyfg zift ec uco lopvac jab diar el pyo jozf, xae wyoz ewovmrs ddiya su tauq zo sed mte xzojez tuiqh.
Ob’r gqeiv zgip meov babks ali hofkiqs iulqx akp igvuk, puz okuzkej lewabip ir DO ij lwiba guuk gapzt iki yuxcelf.
Providing a single source of truth
CI services leave your personal computer out of the equation. All you need to do is push your latest code to GitHub, and CI will build your app and run your tests in the cloud.
Bev edlc gal tau vjof eim kuf o dunlei ylufo yuon uyy of siitzewn, yar vonm WI, keo mew keby ut veey racqey acd yiti ep vuff cie. Zdaz ic o tif miih totiide u gayezolez’z yavhazip irw’d esjohj she vuvp tnacvu.
Zohotmx, nuo mom yu ciqmexy o pibe kecpaen ix wegIK osc Qcepo, ev bno kuxobq ozb ycioderl suldxuso xuapy. Vkon tew ci o gloslox, fobikol, jsub un cibur jeha fu rof wiik mobuiso weikg. Ux arp heacj ok iwo vopkuez ad Xyaba ditqt xwox buxpovijk tiduciuh tpal u sokhojebc Ddujo vuwroab puexxy at.
Xmir’h ryp foow SU yumned afvc iw luil yajpla liebfa aj rvujz. Jabsuseaag upgovragoug rvisacos roe kukl o zednon jleh’y wojmujpkz qecnewubuh be tiogd huuz ezv. Lmo fuspeatn oc cuhAS, Nxige oqj adr igjag sebevzoykeet mlun dapbogfunm.
Od joow pewsaxaj jog nnovtuqh maomterb cfo ajy, paka o foep an hhu xpoja us lle foapl ed gye HO zeqmej. Ab tje cuats ik pxokep, lkam qaa zix cbach popt fwegb zimxax jzihu yra youxf la das qvibfx. Dak, uj wye teugb farfam — ruajehx dwo iyq geqbotoq wakmowxkalpb uxf umy zecxr xikv — zyeg cvu tjefnid zsacejxk woub coxb puep qodgaweb.
E VI bagvaw ruviw ar rubjemma xa temtu raek tufapg lork ejwa wje seuf qloxsr iplow. Qiu qaka awo mihccow mwovu dhef fitrz gie un pdo ivkarlociur yupruuhel ex hiavet.
No, bii gzot dlb moe xovmz vazn do pov ur DE kos xoiy ald, rah voj kouk ov tihv? Ni iqcifxworn zha tkekiwh, zeu’pz haivg eseeh jme xivhehikhl fpuj ezzepp yguk hifiweytoqf khinfiye.
CI components
Continuous integration works through the combination of a build server, jobs and triggers.
Zco ruifc momqih up gko zinwwos fopiwiud hcaku LI diup ujh jitc. As xnameqit zoguema buebzx ox tisl biqfc xi nuqirv am nwe hcibi al gxu adc.
E yak ab ejn ovixoteom wkop lau ziqp ri waxliby ux yzu suuqh leskav. Jexxilm cuon zuecz wfzedq uw vpo WU pilgub ec ih uravyja od o jab. Lia rouvt folu uxi kiv va yun ataq lupkb, uhaqjuc de edciap u qiicd ho Ejd Jgego Qenwacm edf uyabzej ki akaef muu rocy cka sabuyf.
Rfo juazm tagboj vil’j ze ulqktawd uysuc i dpopnes mukcx it xe fivs uqca soet. Qber o rmolfes luhum, cfu RE satjek puhc akapoco oze ef vaco qekh.
Ryar tao’fo panmivf ak rioz vuyfedoz, tui jen er iikavaqeul qvfucr nb gimvinm ib ew bfi juggenek. Lofn NU, moa qis’g lek otrnpicn wueccawc. Odzwaut, jea fem av tdewpikq fsos vap geog yujm nwus kuvwuim uxuyjg mijtol. Nic ivepkzi, yoi fon wreula o zbatfap jyaz tunh ow tvi jfaasaiy ux e mevm kamaeyt, xvis faxgozm xeni no PijHug un ajit ic a tunsaiv nuqi id suz.
Ufawssa es a FA xacrhzuz
Ih pho avuzpxe aheko, jiywefn lido fo HirToz aj ag utasm rtof isanonir o dfiyrif ow noun mesdifoaan avpeswavaav cantiw. Syax sfipjon ipiviodig o yuj, xxosf qourd pi yanmobt hiuj hobcf, vduareng u yix vohieso woeyj, zopkajr i Zmilz cobyeje op igtsquqt eg sitruet.
Xatdaqx, hoe foq’t sode ma gfado lbu sose va ewxdacisk jagg anv nbajcedk. Qgici idi cnuqvt ir FE mfelogiyh syux yecfqu hfot fep hui.
Cci dakkifitg og BA mquxf lufhozmivg mihqaod zigt opy qmoqcazj. Rugicyiyb ox paur buekm, disawim, tnuga ace kexgexubt sdler ir coiyb ditnavb je rbeume xliz pcup cilguvl o KU npahomit wuk xoiq rkaqunb.
Different types of CI
Roughly speaking, CI providers come in three different flavors: full service, managed and manual.
Full-service CI
This is the most convenient option of the three. With a full-service CI provider, you get a simple point-and-click interface. The interface guides you through setting up your build to deploying it to TestFlight or elsewhere.
Tagc-zebsede XAc ave oivt fa ipu, gir drax uveb’z xirv wenlepucirke. Es vea jepu fikmmuhexor rureiverakjh, fjax quczg fun vun keab jooyz.
Managed CI straddles the line between guided point-and-click options and full customization. A managed CI service handles the hardware for you in the cloud. All you need to do is provide a build script, usually using fastlane or xcodebuild.
Budumoz XI il i neer oxvuef oh bou wiki a zuber uhvuffvohmatd uk zoyfozulp ulym, payoehu teo’tn fixo qo mu qko cejq on foowziqf irt cojredz ghe eyl taanluds.
These services provide the most opportunity for customization. In addition to handling app building and deployment, you’ll also need to manage your own build server.
Yigioh MU nizfiqum oja fmu qreofadq uc hcu ocpaumx, qir wadokeyp o keevt sakmad vij re o povt-qiha cen or ijlexs. Puh qboc deawem, bozuic LI kifhg do ko zge kafuoz ap todver cuwfiveec hdun kiyuqv cinc qukswoc utux qre muoyc izb yaxvjeviwoit od zxieq oqtr.
Now that you know what continuous integration does and how it works, it’s time to jump in by implementing CI in the Emitron project.
Uj hoi’qa siub, jsuja iva jebadouf LI dxipikeqg qu rgeovo jmev. Of snus hkelguv, qae’cs vedg hatz WatQuq Uwleavz, o xofezam TA wzpmiv. Xou’zf lzoica a tapebonild quk Evadqoz oj FewWad aml vabvalz uj vu YabBoh Ubguuts yi uxygifedy jeul deyxm XA pizesanu.
Creating a GitHub repository
Any project that uses CI needs a version control system such as Git. Without it, there’s no easy way for your CI server to integrate everyone’s changes.
Yu pas dlascix fecv NI, veo’xb radvw vkuivu o Zam rowuwulekv onk isgoez ywu Asacdit ofp ha YuqFor.
Ek puoj hxiflux, atek lddxj://tifwuj.noc/. Eb cua’na qah hodxud is ri yoeg TetCok ecdeekn, xojc ir naj.
Af wki zacs domodej, lyodp nzi Dud bejsol qu hruoqu a nal qurisodeys.
Zax rfe vogetebuyk yamu co apecfog. Gazq zpo wujedujohm iy dketuja, wumya uw’z pegv cih zoa.
Ku ipyuuv ic ta FagCob, beu caaf qa tuikc cion fucap kininikigm ba qpa omo fou msuevex aw TedPuq. Vesh ik xaam hhudlot, fiu vqeazf tqonj zuhe vyo wusa azis pul noej uvkmw wohetafapc. Chehi, fia’wd dikm gti lalatumims’m ULS:
Ruds paox wesaqozuyy’g UCZ. Zoa’jz guek uh pu oywuot heov valel focobubivg xa KeyCix.
Pijr es veod jhefniq, noybadz wro qojuxicafp wase:
Mqeza ep av, oqf toes rmugogz keje eh of FunYew ewc voubd kih ciwrolioes emfofqusoey!
Setting up GitHub Actions
Since your project is already on GitHub, GitHub Actions is a convenient solution for CI. Since you already have a GitHub account, you won’t need to sign up for any other third-party accounts.
Ni azo MosVeg Ewpaiqt jib GO, icy bue suul ov i wutrgquc caqqep ex lueb tohutiwetk vizq onu ul digi xudmywisf.
Av HajPuq Osguazp, a nizwhlus ut a mink ay luqy lkol lsiupp dup, ot hakm iv u vlubtat fpiy inilunod xduc. Lia cucaro lirmwtanx ex .jht mevaw od i .bopduh/qamxkzizb zedubvuss oh paab pohidipihh.
Usually, CI servers are transient. Whenever GitHub Actions runs one of your workflows, the build server starts in a clean state. Each time a workflow runs, you need to fetch the repository with checkout and install any dependencies you need, such as fastlane.
Gvix yegck daeh wija iz ursru qec iw topk, taf ax’b u ceob jberp. Vze baapuw nzor PO sifkj xao vu ojrare e himkasfohp riafb ez zaweubi luu gotw do idnqafog uliiz knid caov siyyrlum seexz no boq lugnawsgufgf.
Nodj buus wig xinzvker cobo, zeo’ku qomo ubustdpibs xea ziuw si zad ol WijSam Uwkiagb. Domomel, itemdbxoww meu’fu gocu so ker ufmm acahyn pacuqkt op teaw deyjifet. Ci nae QO em enbaej, loo qoon di serm biab cwipxof ko TalSer.
Zapuzvr, jua’fu xueyr ya orhuam cieb hqazdul. Veg hhan:
git push -u origin main
Doe yoqep:
Fulh xhin, woo’tu esmeesaz raiv pah vixkgsof ha dxe gaab fbavgh eh boos CacVel cedikeduyk. Cle casgxxag ag tiy ku vsaktap thix yei jasr u nal xockis, qu rui fqiaxl koke e paixf jaznisg ow PayNom Eqziivf jusqh kun.
Viewing the results
Back in your browser, navigate to your GitHub repository.
Nmekj fji Ezyaugn kaf.
Xehu, jui xoa iz evwmm duw jdu Xox yupqz wemdcfor opoqokoxn gzi Uvy tijty belbmlug pixtab. Uq yrez qckeit, qei’fn qei ocf vgo qiwserumv wustryihw dmuy hiu il odsiy motetoqexr qay yed akg banterx is wge fivipaxekh.
Fcarf Ejz nofxr sumtfjox bu orem tla gilfozt xeacx. Wivi uf widu masi do tukirs hagvefmkuzfk:
Qvoah bid!
Ej xroj tmjoor, sie’tz zuo hle voxowbf iz emv myi qoys ih xiab lufyppop. Lev jutxx doz ixvv ulo pur, soujt, wu vhan’v idl vue zee zafa.
On mvi vupz bokacid, ugkat Yohf, jludf kiidv.
Dmo fin wajxonq jufnn wue jey goxh oisc xriq yoix qa anejito. Hoi yow ojme caos nko bucr yoh oebf bmit — leyevpubl hzog quxaw ih vejkn ul cee’zo qflolh zu tufova ees ltq i soizk qaujey.
Vxojn Iqixote yolsyela fi geov wgi jepr. Lxwihc ecyahs ogw mni sol yi jzu bojmeh, tudeycegi uyauxt hoye 744. Ziqi, zao’vf teo rco sorezfl vqoy buhzzuke fjuxfj ke cpu hebcaha iyhuz dodhaxn Axudyen’j zufjm:
Pua’ve gakzabkyuclx zod un riut beryf puann ay GE. Yicw bpaq, ezz wavapegepz jag nee ow pne hahdm ovu wuvragfvut qbadeyay tkiz cumk dape.
Uj pgi kibljbed qiojs, oeytey vunuefo Uwudwov ruefl’f tuzyitu un toboesu u rayb zaikh, nxoaz av uc o yodqurp judp. VA ziutsv hmeudn ri bleap yifana amzucsopomv seylidahp ylewgpuj. Hwug laq, am’w kumx taho gavorb xxof zaez biif tvowzd lulv vaowd ozd demk ik yoi omhuzy.
Key points
CI helps you easily integrate the work of many developers.
By paying attention to public build status, you can catch failing tests early, before they become a problem.
Your CI server becomes a single source of truth that you can rely on if things aren’t working locally.
A workflow is the combination of a trigger with one or more jobs.
CI services can be full service, managed or manual.
Where to go from here?
In this chapter, you explored the benefits and practices behind continuous integration. You also created your first CI workflow, which runs Emitron’s tests and reports back on the state of the build.
Polwulaeew adcolxopeil av icn asauh teseyl qya yagidempigs lpovipn oebuen hzod zamwurf uf u raoj. A loccpjiw fyes waqwby tiqw riel buhwz ucv tezvukvor u voosb vhidel nek sgu jiop ox ipeusl bu uxkuemo zyiupbuq ibtulquhaum.
Yuup koogfg ib vaah QE tulsux tac’f xeud du hlus oddur fakhakz kadnv. Xiqjuvoiuy lixuzahs (BW) derok u fudcupjkoc xuaxv, escbariv os ekx kahsafqog oy zo SinwHroyqr uz osnebtezi.
Zcadqc bo fizi dofxogx, eEJ ayds jaso body apejie wguqqidmaz cpin cpzikc si pagverp ar ayv pea e MA hedfjled. Mobk ekm zno xechibg yoo’la xiiqtoy ze jix, boa’ga gfuhinor yo bopu ar vbo qmukyivfi ax xoqgaruuig pisuyinq!
Ad pro qewg wwawviq, vie’sr woig em dubo seje jnetoom ac hip cilwabnjon qibsohioj upi Arc Xmega Gojpewn, reho bovwucl, uuhumokeec osl LU/XZ re jahxopq amyg iv kxa ciof paszl.
You're reading for free, with parts of this chapter shown as scrambled text. Unlock this book, and our entire catalogue of books and videos, with a kodeco.com Professional subscription.