Logo Jay's Blog
  • 首頁
  • 關於
  • 最近文章
  • 文章
Logo Inverted Logo
  • 标签
  • Algorithm
  • Array
  • Backup
  • Binary-Search
  • Combinatorics
  • Docker
  • Dynamic-Programming
  • Git
  • Github
  • Github-Action
  • Homelab
  • Leetcode
  • Linux
  • Opencv
  • Openwrt
  • Pcloud
  • Raspberry-Pi
  • Raspberry-Pi-3
  • Raspberry-Pi-4
  • Rclone
  • String
  • Synology
  • Vpn
  • Yolo
Hero Image
如何在 Local 端測試/執行 Github Actions

前言 最近在寫 side project 時想要設定 Github Actions 來自動化編譯跟測試流程,但是按照我之前的經驗是第一次設定 github action 的 workflow 時都會需要不斷修改來達到自己想要的結果,但是如果想要測試的話就會需要一直 commit & push 到 github 上面才有辦法測試,因此這次在設定 workflow 前,我想要找到一個可以不用 push 到 github 就可以在 local 端測試我的 workflow 的工具,這樣我就可以先測試完我的 workflow 後再一次 push 上去 github, 減少設定錯誤的機會,也不用一直繁瑣的 commit & push. 而我找到的工具就是 nektos/act 這個專案,目前在 github 上約有 40k 個 stars,可見這個需求有多大,本篇文就是紀錄如何使用這個工具的筆記。 Install nektos/act 這個專案有提供多種平台以及安裝方式,因為基本上我只會用這個工具來測試我的 workflow 有沒有寫錯,因此我選擇的是安裝官方提供的 GitHub CLI 擴充套件 Install Github CLI Offical installation guide 首先按照官方教學安裝 Github CLI type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y) curl -fsSL https://cli.

  • github
  • github-action
Saturday, July 15, 2023 | 1 閱讀
導覽列
  • 關於
  • 最近文章
聯絡方式:
  • jay101630@gmail.com

Toha Theme Logo Toha
Copyright © 2022 Jay’s Blog. All right reserved.
Powered by Hugo Logo