diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f906712..3269f99 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -16,6 +16,9 @@ env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} TEST_TAG: ${{ github.repository }}:test + TEST_EXPECTED_NODE_OUTPUT: "v14.16.1" + TEST_EXPECTED_ELIXIR_OUTPUT: "Elixir 1.12.2 (compiled with Erlang/OTP 24)" + TEST_EXPECTED_ERLANG_OUTPUT: "Erlang/OTP 24" jobs: build-and-push-image: runs-on: ubuntu-latest @@ -57,13 +60,13 @@ jobs: # NOTE: the following tests rely on grep exit code (0 if match found) - name: Test that Node can start and has expected version - run: docker run --rm ${{ env.TEST_TAG }} /bin/bash -c 'node --version' | grep 'v14.16.1' + run: docker run --rm ${{ env.TEST_TAG }} /bin/bash -c 'node --version' | grep '${{ env.TEST_EXPECTED_NODE_OUTPUT }}' - name: Test that Elixir can start and has expected version - run: docker run --rm ${{ env.TEST_TAG }} /bin/bash -c 'elixir --version' | grep 'Elixir 1.12.2 (compiled with Erlang/OTP 24)' + run: docker run --rm ${{ env.TEST_TAG }} /bin/bash -c 'elixir --version' | grep '$${ env.TEST_EXPECTED_ELIXIR_OUTPUT }}' - name: Test that Erlang can start and has (major) expected version - run: docker run --rm ${{ env.TEST_TAG }} /bin/bash -c "erl -noshell -eval 'erlang:display(erlang:system_info(system_version))' -eval 'init:stop()'" | grep 'Erlang/OTP 24' + run: docker run --rm ${{ env.TEST_TAG }} /bin/bash -c "erl -noshell -eval 'erlang:display(erlang:system_info(system_version))' -eval 'init:stop()'" | grep '$${ env.TEST_EXPECTED_ERLANG_OUTPUT }}' # TODO: handle testing then publication using: # - https://github.com/etalab/transport-ops/issues/30