Your first workflow
From the file's directory structure to reading a failure log.
A project's first workflow almost always fails, and almost never for the reason you expect. The file is ignored because it's in .github/workflow/, singular. The npm test command reports that package.json can't be found, because the repository was never checked out. Or everything works, and you discover that the tests take thirty seconds instead of three, because nothing is cached. All three pitfalls come from the same blind spot: a runner is an empty machine that knows nothing about your project.
This lesson builds a genuinely usable test workflow one line at a time, explaining for each line what breaks if you leave it out. It ends with reading an execution log, because the skill that saves you the most time in the long run isn't writing the file, it's knowing, within thirty seconds, whether a failure comes from your code or from your configuration.
File location
GitHub only detects .yml or .yaml files located directly in .github/workflows/, at the root of the repository.
mon-projet/
├── .github/
│ └── workflows/
│ ├── tests.yml
│ └── publication.yml
├── src/
└── package.json
Comments
Comments are powered by GitHub Discussions
Sign in with GitHub to join the discussion