Ability to define steps within the plugin #293
Description
Activity
Hi Kamil Janowski (@kamiljano),
Thank you for reaching out!That makes sense! You want to modularize your GitHub Actions workflow by breaking down your current runCmd monolithic script into separate, easily understandable steps. By doing this, you can better organize and manage each task individually, as well as improve readability and debugging in case something fails.
You can define your steps in the workflow.yml file under the jobs section. Here’s an approach where each operation (node tests, linting, Python tests, etc.) is defined in separate steps.
name: CI Pipeline
on:
push:
branches:
- main
pull_request:
branches:
- mainjobs:
build:
runs-on: ubuntu-latest
container:
image: your-container-image:latest # Replace with your container imagesteps: - name: Checkout code uses: actions/checkout@v3 # Node.js related tasks - name: Install Node dependencies run: pnpm install - name: Run Node tests run: pnpm run test # Additional build or deployment steps can go hereHope this info helps you define the steps!
Please feel free to reach out again in case of any further queries.Thanks,
SireeshaThe above isn't practical because the GHA
containerfeature will just do adocker runwith the image, Even if you built that image earlier usingdevcontainer buildCLI directly (or via this Github Action). Unless you use the devcontainer CLI to spin up the container usingdevcontainer up, you will be missing things (hooks, mount configs, probs other stuff I don't know about).Unless you duplicate that configuration by copying that config into the GHA workflow as parameters to the container creation. And that defeats the purpose of this GitHub action, which I believe is to centralise all of that in one canonical place, eliminating the need for this.
However....
🎉The workaround
I figured it out. I posted it over on this issue over here, which is the same thing as this one.
I have a number of operations that I would like to execute within the container. There are node tests, linting, type checking, building, python tests and linting and type checking... that's arguably a lot of stuff. Yet, currently everything goes into a single step in GitHub actions - the container build step.
Rather than define everything in the
runCmdproperty, I would like to be able to define basic steps asAnd that would end up in separate steps within GitHub actions.