Merge pull request #117 from aminvakil/crypto-0.31.0 #57
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: CI/CD | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
hadolint: | |
name: Test dockerfile syntax | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the codebase. | |
uses: actions/checkout@v4 | |
- uses: hadolint/hadolint-action@v3.1.0 | |
with: | |
ignore: DL3018 | |
build: | |
name: Build and test docker | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the codebase. | |
uses: actions/checkout@v4 | |
- name: Build docker image. | |
run: docker build --no-cache --tag ${GITHUB_REPOSITORY,,}:${GITHUB_RUN_ID} . | |
- name: Run a container of created image. | |
run: | | |
DOCKERCONTAINER=$(docker run -d ${GITHUB_REPOSITORY,,}:${GITHUB_RUN_ID}) | |
sleep 5 | |
echo "DOCKERCONTAINER=$DOCKERCONTAINER" >> $GITHUB_ENV | |
- name: Check if container is still running. | |
run: docker ps -f id=${DOCKERCONTAINER} | |
- name: Check if the container is correctly stopped and removed. | |
run: docker stop ${DOCKERCONTAINER} && docker rm -fv ${DOCKERCONTAINER} |