wip: replace microdnf with dnf #192
This file contains hidden or 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: Build and Push Docker Image | |
| on: | |
| push: | |
| pull_request: | |
| types: [opened, reopened, synchronize] | |
| workflow_dispatch: | |
| inputs: | |
| push_to_dockerhub: | |
| description: 'Push to Docker Hub' | |
| required: false | |
| default: 'false' | |
| type: boolean | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Load configuration | |
| run: | | |
| echo opensource_COBOL_4J_version="$(jq -r '.opensource_COBOL_4J_version' build-config.json)" >> $GITHUB_ENV | |
| echo Open_COBOL_ESQL_4J_version="$(jq -r '.Open_COBOL_ESQL_4J_version' build-config.json)" >> $GITHUB_ENV | |
| echo version_string_prefix="$(jq -r '.version_string_prefix' build-config.json)" >> $GITHUB_ENV | |
| - name: Build a docker image | |
| run: | | |
| docker build -t opensourcecobol/opensourcecobol4j:"$version_string_prefix" . \ | |
| --build-arg opensource_COBOL_4J_version="$opensource_COBOL_4J_version" \ | |
| --build-arg Open_COBOL_ESQL_4J_version="$Open_COBOL_ESQL_4J_version" | |
| - name: Copy Docker image | |
| run: | | |
| docker tag opensourcecobol/opensourcecobol4j:"$version_string_prefix" opensourcecobol/opensourcecobol4j:latest | |
| - name: Show Docker image size | |
| run: | | |
| docker images opensourcecobol/opensourcecobol4j:"$version_string_prefix" --format "table {{.Repository}}:{{.Tag}}\t{{.Size}}" | |
| - name: Check the version of installed software | |
| run: | | |
| docker run --rm opensourcecobol/opensourcecobol4j:latest sh -c "cobj --version | grep 'opensource COBOL 4J $opensource_COBOL_4J_version'" | |
| docker run --rm opensourcecobol/opensourcecobol4j:latest sh -c "! cobj --version | grep 'unicode/utf-8 support'" | |
| docker run --rm opensourcecobol/opensourcecobol4j:latest sh -c "ocesql --version | grep 'Version $Open_COBOL_ESQL_4J_version'" | |
| - name: Run simple tests inside the container | |
| run: | | |
| docker run -itd --name test_container opensourcecobol/opensourcecobol4j:latest | |
| docker exec test_container sh -c "cd /root/cobol_sample && cobj HELLO.cbl && java HELLO" | |
| docker rm -f test_container | |
| - name: Login to Docker Hub | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' && inputs.push_to_dockerhub == true | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Push to Docker Hub | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' && inputs.push_to_dockerhub == true | |
| run: | | |
| docker push opensourcecobol/opensourcecobol4j:"$version_string_prefix" | |
| docker push opensourcecobol/opensourcecobol4j:latest | |
| utf8-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Load configuration | |
| run: | | |
| echo opensource_COBOL_4J_version="$(jq -r '.opensource_COBOL_4J_version' build-config.json)" >> $GITHUB_ENV | |
| echo Open_COBOL_ESQL_4J_version="$(jq -r '.Open_COBOL_ESQL_4J_version' build-config.json)" >> $GITHUB_ENV | |
| echo version_string_prefix="$(jq -r '.version_string_prefix' build-config.json)" >> $GITHUB_ENV | |
| - name: Build a docker image | |
| run: | | |
| docker build -t opensourcecobol/opensourcecobol4j:utf8-"$version_string_prefix" . -f utf8.Dockerfile \ | |
| --build-arg opensource_COBOL_4J_version="$opensource_COBOL_4J_version" | |
| - name: Show Docker image size | |
| run: | | |
| docker images opensourcecobol/opensourcecobol4j:utf8-"$version_string_prefix" --format "table {{.Repository}}:{{.Tag}}\t{{.Size}}" | |
| - name: Check the version of installed software | |
| run: | | |
| docker run --rm opensourcecobol/opensourcecobol4j:utf8-"$version_string_prefix" sh -c "cobj --version | grep 'opensource COBOL 4J $opensource_COBOL_4J_version'" | |
| docker run --rm opensourcecobol/opensourcecobol4j:utf8-"$version_string_prefix" sh -c "cobj --version | grep 'unicode/utf-8 support'" | |
| - name: Run simple tests inside the container | |
| run: | | |
| docker run -itd --name test_container opensourcecobol/opensourcecobol4j:utf8-"$version_string_prefix" | |
| docker exec test_container sh -c "cd /root/cobol_sample && cobj HELLO.cbl && java HELLO" | |
| docker rm -f test_container | |
| - name: Login to Docker Hub | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' && inputs.push_to_dockerhub == true | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Push to Docker Hub | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' && inputs.push_to_dockerhub == true | |
| run: | | |
| docker push opensourcecobol/opensourcecobol4j:utf8-"$version_string_prefix" |