This repository has been archived on 2024-09-20. You can view files and clone it, but cannot push or open issues or pull requests.
docker-run-action/.github/workflows/1-tests.yml

46 lines
1.2 KiB
YAML
Raw Normal View History

2021-02-15 21:58:29 +01:00
name: Docker Run Action Tests
on:
push:
branches:
- main
pull_request:
jobs:
smoke-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./
2021-02-15 22:28:52 +01:00
id: run-docker
2021-02-15 21:58:29 +01:00
with:
image: docker:20.10.3
run: |
2021-02-15 22:28:52 +01:00
echo "::set-output name=docker-version::`echo $DOCKER_VERSION`"
2021-02-15 21:58:29 +01:00
- uses: actions/github-script@v3
with:
script: |
2021-02-15 22:28:52 +01:00
const dockerVersion = '${{ steps.run-docker.outputs.docker-version }}';
2021-02-15 22:52:12 +01:00
if (dockerVersion !== '20.10.3') {
2021-02-15 22:28:52 +01:00
core.setFailed(`Smoke Test Failed`);
}
2021-02-15 22:52:12 +01:00
volume-mount-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: echo "some text" > someFile
- uses: ./
id: run-docker
with:
image: docker
options: -v ${{ github.workspace }}:/work
run: |
echo "::set-output name=file-contents::`cat /work/someFile`"
- uses: actions/github-script@v3
with:
script: |
const fileContents = '${{ steps.run-docker.outputs.file-contents }}';
if (fileContents !== 'some text') {
core.setFailed(`Unable to mount workspace volume`);
}