Change container name #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Build and Test | |
on: | |
push: | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
tags: test-container | |
context: . | |
push: false | |
- name: Run container | |
id: run | |
run: | | |
docker run --name test-container -d YOUR_IMAGE_NAME | |
- name: Compile examples | |
run: | | |
docker exec test-container bash -c "cd /path/to/examples && make" | |
- name: Test sudo | |
run: | | |
docker exec test-container bash -c "sudo apt-get update" |