BM: Baca dalam Bahasa Melayu
World 7: Robots: Actions & CI/CD
Matrix, cache, artifacts
You will learn: how to test many setups at once, save time, and keep files from a run.
The problem
Your site must work on Node 22 and Node 24. Copy the whole test job twice? Then fix every bug twice? What’s the best plan?
Pick one answer.
Watch
Tap the line that lists the versions.
0 of 1 found
A matrix: One job recipe that runs once for each item in a list. is one job recipe plus a list. GitHub runs one copy per item. ${{ matrix.node }} is that copy’s item.
Predict
You add a second list, os:, with Linux and Windows. How many jobs run?
Pick one answer.
Watch
Tap each point on the timeline.
A cache: Saved downloads that make the next run faster. is a pantry. The first run shops and stores. Later runs grab from the shelf. cache: npm in setup-node turns it on.
Watch
Tap the line that says which folder to save.
0 of 1 found
An artifact: Files a workflow run saves, so you can download them later. is a takeaway box. A job packs files into it. After the run, you can download them. By default, GitHub keeps them 90 days.
Try it
Pantry or takeaway box? Sort each one.
Drag a card into a box. Or tap the card, then tap the box.
You did it!
You can now run a matrix, cache downloads and save artifacts.
Go deeper (optional)
When one matrix job fails, GitHub cancels the others. Set fail-fast: false to see every result. For other folders, actions/cache@v6 takes a path and a key. GitHub removes cache entries nobody used for 7 days.
Bahasa Melayu
Laman anda mesti jalan pada Node 22 dan Node 24. Salin seluruh job ujian dua kali? Kemudian baiki setiap pepijat dua kali? Apa rancangan terbaik?
Matrix ialah satu resipi job dan satu senarai. GitHub jalankan satu salinan untuk setiap item. ${{ matrix.node }} ialah item untuk salinan itu.
Anda tambah senarai kedua, os:, dengan Linux dan Windows. Berapa job berjalan?
Cache ialah almari dapur. Larian pertama membeli dan menyimpan. Larian seterusnya ambil dari rak. cache: npm dalam setup-node hidupkannya.
Artifact (artifak) ialah bekas bungkus. Job masukkan fail ke dalamnya. Selepas larian, anda boleh muat turun fail itu. Secara lalai, GitHub simpan 90 hari.
Almari dapur atau bekas bungkus? Susun setiap satu.
Kini anda boleh guna matrix, cache muat turun dan simpan artifact.
You finished this before. Practice is always welcome!
Official docs: Running variations of jobs (matrix) · Dependency caching · Workflow artifacts
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?