I am fairly competent in using GitHub actions to build a variety of languages, orchestrate deployments, and I've even done cross-repository actions using web-hooks, so I'd say that I'm pretty familiar with working with them.
I often find myself doing a lot of scratch projects to test out an API or making a demo, and these don't usually merit their own repositories, but I'd like to save them for posterity, rather than just making Gists out of them, Gists being largely impossible to search. I'd like to create a scratch repository, with folders per language, like:
.
└── scratch
├── go
│ ├── dancing
│ │ ├── LICENSE-APACHE
│ │ ├── LICENSE-MIT
│ │ ├── main.go
│ │ └── README.md
│ ├── gogettur
│ │ ├── LICENSE-APACHE
│ │ ├── LICENSE-MIT
│ │ ├── main.go
│ │ └── README.md
│ └── streeper
│ ├── LICENSE-APACHE
│ ├── LICENSE-MIT
│ ├── main.go
│ └── README.md
├── node
│ └── javawhat
│ ├── index.js
│ ├── LICENSE-APACHE
│ ├── LICENSE-MIT
│ └── README.md
└── rust
├── logvalanche
│ ├── Cargo.toml
│ ├── LICENSE-APACHE
│ ├── LICENSE-MIT
│ ├── README.md
│ └── src
├── streamini
│ ├── Cargo.toml
│ ├── LICENSE-APACHE
│ ├── LICENSE-MIT
│ ├── README.md
│ └── src
└── zcini
├── Cargo.toml
├── LICENSE-APACHE
├── LICENSE-MIT
├── README.md
└── src
I'd like to generalize GitHub actions per language, for Go, use go test ./... and go build, for Rust cargo test and cargo build, etc.
I know that what I could do is have a workflow for each created project, but this would be tedious, I'd end up copying and pasting most of the time, and every build would run on every change in the entire repository, and I don't want to be building node/javawhat if only rust/zcini has changed.
Therefore I have a few questions:
- Is it possible to have a workflow only run when certain files have changed, rather than running everything every single time?
- Is there a way to generalize my workflows so that every dir in
rust/uses the same generic workflow, or will I need one workflow per project in the repository?