<commit_before>name: ci

on: [push]

jobs:
  main:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      -
        name: Set up QEMU
        uses: docker/setup-qemu-action@v1
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      -
        name: Cache Docker layers
        uses: actions/cache@v2
        with:
          path: /tmp/.buildx-cache
          key: ${{ runner.os }}-buildx-${{ github.sha }}
          restore-keys: |
            ${{ runner.os <KEY>
      -
        name: Build a dev image
        id: docker_build
        uses: docker/build-push-action@v2
        with:
          context: .
          file: ./Dockerfile.dev
          push: false
          load: true
          tags: transformimgs-dev
          cache-from: type=local,src=/tmp/.buildx-cache
          cache-to: type=local,dest=/tmp/.buildx-cache
      -
        name: Run tests
        run: |
          docker run --entrypoint=/go/src/github.com/Pixboost/transformimgs/test.sh -v $(pwd):/go/src/github.com/Pixboost/transformimgs  transformimgs-dev
      -
        name: Code coverage
        run: |
          bash <(curl -s https://codecov.io/bash)
      -
        name: Build a prod image
        id: docker_build
        uses: docker/build-push-action@v2
        with:
          context: .
          file: ./Dockerfile
          push: false
          load: true
          tags: transformimgs
          cache-from: type=local,src=/tmp/.buildx-cache
          cache-to: type=local,dest=/tmp/.buildx-cache
      -
        name: Run the service
        run: |
          docker run -p 8080:8080 -d transformimgs
      -
        name: Smoketest
        run: |
          curl -f http://localhost:8080/img/fwfwekfwe/resize<commit_msg>Smoke test on build<commit_after>name: ci

on: [push]

jobs:
  main:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      -
        name: Set up QEMU
        uses: docker/setup-qemu-action@v1
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      -
        name: Cache Docker layers
        uses: actions/cache@v2
        with:
          path: /tmp/.buildx-cache
          key: ${{ runner.os }}-buildx-${{ github.sha }}
          restore-keys: |
            ${{ runner.os }}-buildx-
      -
        name: Build a dev image
        id: docker_build_dev
        uses: docker/build-push-action@v2
        with:
          context: .
          file: ./Dockerfile.dev
          push: false
          load: true
          tags: transformimgs-dev
          cache-from: type=local,src=/tmp/.buildx-cache
          cache-to: type=local,dest=/tmp/.buildx-cache
      -
        name: Run tests
        run: |
          docker run --entrypoint=/go/src/github.com/Pixboost/transformimgs/test.sh -v $(pwd):/go/src/github.com/Pixboost/transformimgs  transformimgs-dev
      -
        name: Code coverage
        run: |
          bash <(curl -s https://codecov.io/bash)
      -
        name: Build a prod image
        id: docker_build_prod
        uses: docker/build-push-action@v2
        with:
          context: .
          file: ./Dockerfile
          push: false
          load: true
          tags: transformimgs
          cache-from: type=local,src=/tmp/.buildx-cache
          cache-to: type=local,dest=/tmp/.buildx-cache
      -
        name: Run the service
        run: |
          docker run -p 8080:8080 -d transformimgs
      -
        name: Smoketest
        run: |
          curl -f http://localhost:8080/img/fwfwekfwe/resize
{'fraction_non_alphanumeric': 0.110494169905608, 'fraction_numerical': 0.009994447529150472, 'mean_word_length': 1.4779917469050894, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4910284', 'n_tokens_mistral': 1189, 'n_tokens_neox': 1120, 'n_words': 248}