我想使用依赖于Docker Hub中发布的容器的测试来执行CI。可能吗?我可以启动容器并运行依赖它的测试吗?
答案 0 :(得分:0)
是的,这是一个使用docker-compose的示例:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
- name: Login to Docker Registry
run: docker login "$DOCKER_REGISTRY" -u "$DOCKER_USERNAME" --password-stdin <<< "$DOCKER_PASSWORD"
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
- name: Start env
run: docker-compose up
- name: Run tests
run: ...