check running containers and update status #15
This file contains hidden or 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: Go Build and Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Install Go | |
| run: | | |
| sudo apt update | |
| sudo apt install -y golang | |
| go version | |
| - name: Set up Go environment | |
| run: | | |
| mkdir -p $HOME/go/{bin,src,pkg} | |
| echo "export GOPATH=$HOME/go" >> $HOME/.bashrc | |
| echo "export PATH=$PATH:$HOME/go/bin" >> $HOME/.bashrc | |
| source $HOME/.bashrc | |
| - name: Install dependencies | |
| run: go mod tidy | |
| - name: Create required directories | |
| run: | | |
| mkdir -p /tmp/basic-docker/containers | |
| mkdir -p /tmp/basic-docker/images | |
| - name: Build project with error handling | |
| run: | | |
| echo "==== Building Project ====" | |
| if ! go build -o basic-docker main.go; then | |
| echo "Error: Build failed. Please check the errors above." >&2 | |
| exit 1 | |
| fi | |
| - name: Run verification script | |
| run: | | |
| chmod +x verify.sh | |
| ./verify.sh |