How to use it
- Choose the language and list the versions you support.
- Set the branches that should run CI on push, the runner, and whether to run on pull requests.
- Copy the YAML to
.github/workflows/ci.ymland commit it.
Check current versions
Actions are referenced as name@vN. The majors used here are actions/checkout@v4, actions/setup-node@v4, actions/setup-python@v5, actions/setup-go@v5 and actions/setup-java@v4. Newer majors appear over time, so check current major versions on each action’s repository page before you rely on the file.
What you get
The job installs nothing by itself apart from the language: checkout, setup with the matrix version, then run steps. Node runs npm ci, npm run build --if-present and npm test. Python installs requirements.txt and runs pytest. Go builds and tests all packages. Java uses the Temurin distribution and mvn -B verify.
Example
Node with versions 20 and 22 creates two jobs, each calling actions/setup-node@v4 with node-version: ${{ matrix.node-version }} and cache: npm.
Tips
- Keep the matrix to the versions you really support, since each one costs runner minutes.
- Add a
permissions:block if you want to restrict the default token rights.