File tree Expand file tree Collapse file tree 3 files changed +41
-20
lines changed
Expand file tree Collapse file tree 3 files changed +41
-20
lines changed Original file line number Diff line number Diff line change 1+ name : ' Devcontainer CI Action'
2+ description : ' Run commands in devcontainer'
3+ inputs :
4+ command :
5+ description : ' Command to run in the devcontainer'
6+ required : true
7+ type : string
8+ devcontainer-path :
9+ description : ' Path to devcontainer config'
10+ required : false
11+ default : ' .devcontainer'
12+
13+ runs :
14+ using : ' composite'
15+ steps :
16+ - name : Checkout code
17+ uses : actions/checkout@v4
18+
19+ - name : Login to GitHub Container Registry
20+ uses : docker/login-action@v3
21+ with :
22+ registry : ghcr.io
23+ username : ${{ github.repository_owner }}
24+ password : ${{ secrets.GITHUB_TOKEN }}
25+
26+ - name : Get devcontainer image name
27+ run : |
28+ image="ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}-devcontainer"
29+ echo "IMAGE_NAME=${image,,}" >> $GITHUB_ENV
30+
31+ - name : Run command in devcontainer
32+ uses :
devcontainers/[email protected] 33+ with :
34+ imageName : ${{ env.IMAGE_NAME }}
35+ cacheFrom : ${{ env.IMAGE_NAME }}
36+ push : always
37+ devcontainerPath : ${{ inputs.devcontainer-path }}
38+ runCmd : ${{ inputs.command }}
Original file line number Diff line number Diff line change 1616 cmake --build build --config Debug --target all
1717 cmake --build build --config Debug --target test
1818 cmake --build build --config Debug --target coverage
19+
Original file line number Diff line number Diff line change 1616 packages : write
1717
1818 steps :
19- - uses : actions/checkout@v4
20-
21- - name : Login to GitHub Container Registry
22- uses : docker/login-action@v3
23- with :
24- registry : ghcr.io
25- username : ${{ github.repository_owner }}
26- password : ${{ secrets.GITHUB_TOKEN }}
27-
28- - name : Get devcontainer image name
29- run : |
30- image="ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}-devcontainer"
31- echo "IMAGE_NAME=${image,,}" >> $GITHUB_ENV
32-
33- - name : Run command in devcontainer
34- uses :
devcontainers/[email protected] 19+ - uses : ${{ github.repository_owner }}/${{ github.event.repository.name }}/.github/actions/devcontainer@main
3520 with :
36- imageName : ${{ env.IMAGE_NAME }}
37- cacheFrom : ${{ env.IMAGE_NAME }}
38- push : always
39- runCmd : ${{ inputs.run_cmd }}
21+ command : ${{ inputs.run_cmd }}
You can’t perform that action at this time.
0 commit comments