Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add console output testing for Dockerfiles #395

Open
bitcoin-tools opened this issue Mar 11, 2024 · 0 comments
Open

Add console output testing for Dockerfiles #395

bitcoin-tools opened this issue Mar 11, 2024 · 0 comments

Comments

@bitcoin-tools
Copy link
Owner

bitcoin-tools commented Mar 11, 2024

jobs:
  run-nodebuilder-docker:
    name: Run in ${{ matrix.container }} container
    runs-on: ubuntu-latest
    strategy:
      matrix:
        container: [Alpine, Fedora, Manjaro, Ubuntu]
        include:
          - container: Alpine
            dockerfile: ./dockerfiles/Dockerfile_alpine
          - container: Arch
            dockerfile: ./dockerfiles/Dockerfile_arch
          - container: Debian
            dockerfile: ./dockerfiles/Dockerfile_debian
          - container: Fedora
            dockerfile: ./dockerfiles/Dockerfile_fedora
          - container: Manjaro
            dockerfile: ./dockerfiles/Dockerfile_manjaro
          - container: Ubuntu
            dockerfile: ./Dockerfile
          - container: openSUSE
            dockerfile: ./dockerfiles/Dockerfile_opensuse
    needs: [bash-lint, yaml-lint, dockerfile-lint, markdown-links, markdown-spellcheck]
    steps:
      - name: Check the current OS version
        run: grep "VERSION\|ID" /etc/os-release && uname -a
      - uses: actions/checkout@v4
      - name: Build the docker image
        uses: docker/build-push-action@v5
        with:
          context: .
          file: ${{ matrix.dockerfile }}
          push: false
          tags: my${{ matrix.container }}image:latest
      - name: Run the docker image and capture output
        run: docker run my${{ matrix.container }}image:latest \
          > stdout_${{ matrix.container }}.txt \
          2> stderr_${{ matrix.container }}.txt
      - name: Run test script on stdout
        run: ./test/test_dockerfile stdout_${{ matrix.container }}.txt
      - name: Upload stdout and stderr as artifacts
        uses: actions/upload-artifact@v2
        with:
          name: output-${{ matrix.container }}
          path: |
            stdout_${{ matrix.container }}.txt
            stderr_${{ matrix.container }}.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant