<commit_before>name: "Dev build"
on:
  pull_request_target:
    types:
      - labeled
jobs:
  "build_image":
    runs-on: ubuntu-latest
    if: ${{ github.event.label.name == 'ok to test' }}
    steps:
      - name: Remove label
        uses: andymckay/labeler@master
        with:
          remove-labels: "ok to test"
        if: always()
      - uses: actions/checkout@v2
        with:
          ref: "${{ github.event.pull_request.head.sha }}"
      - uses: actions/setup-go@v2
        with:
          go-version: '^1.17.x'
      - name: Build dev image
        run: |
          TAG="2.4.5-gotest.${GITHUB_SHA:0:7}"
          TELEPRESENCE_VERSION="v${TAG}" make image
          mkdir -p /tmp/workspace
          docker save "datawire/tel2:${TAG}" > tel2-image.tar
      - name: Upload image
        uses: actions/upload-artifact@v2
        with:
          name: image
          path: tel2-image.tar
  "macos_test":
    runs-on: macos-latest
    needs: "build_image"
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
          ref: "${{ github.event.pull_request.head.sha }}"
      - uses: actions/setup-go@v2
        with:
          go-version: '^1.17.x'
      - uses: azure/setup-kubectl@v1
        with:
          version: 'v1.19.3'
        id: kubectl
      - name: "Test arm64 build"
        run: GOARCH=arm64 make build
      - run: make build
      - run: |
          brew update
          brew install --cask macfuse
          brew install gromgit/fuse/sshfs-mac
          brew link --overwrite sshfs-mac
        name: install dependencies
      - uses: actions/download-artifact@v2
        with:
          name: image
      - uses: ./.github/actions/prepare-kluster
        with:
          platform: macos
          token: ${{ secrets.DEV_TELEPRESENCE_KUBECEPTION_TOKEN }}
          tel-image: tel2-image.tar
        id: kluster
      - run: |
          # We want to validate that tests still pass, even if the metrics host
          # points to a broken IP
          echo "127.0.0.1 metriton.datawire.io" | sudo tee -a /etc/hosts
          DTEST_KUBECONFIG="${{ steps.kluster.outputs.kubeconfig }}" DTEST_REGISTRY="docker.io/datawire" make test
        name: Run tests
      - uses: ./.github/actions/upload-logs
        if: always()
      - uses: ./.github/actions/cleanup-kluster
        with:
          platform: macos
          token: ${{ secrets.DEV_TELEPRESENCE_KUBECEPTION_TOKEN }}
        if: always()
  "windows_test":
    runs-on: windows-2019
    needs: "build_image"
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
          ref: "${{ github.event.pull_request.head.sha }}"
      - uses: actions/setup-go@v2
        with:
          go-version: '^1.17.x'
      - uses: azure/setup-kubectl@v1
        with:
          version: 'v1.19.3'
        id: kubectl
      - run: |
          choco install make
          mkdir -p build-output/bin
          curl.exe -LO https://www.wintun.net/builds/wintun-0.12.zip
          Expand-Archive -Path wintun-0.12.zip -DestinationPath .
          #cp wintun/bin/amd64/wintun.dll "$ENV:SystemRoot\\system32\\wintun.dll"
          #cp wintun/bin/amd64/wintun.dll .
          cp wintun/bin/amd64/wintun.dll "build-output\\bin"
        name: install dependencies
      - name: "Download sshfs"
        run: |
          curl -L -o winfsp.msi https://github.com/billziss-gh/winfsp/releases/download/v1.9/winfsp-1.9.21096.msi
          curl -L -o sshfs-win.msi https://github.com/billziss-gh/sshfs-win/releases/download/v3.7.21011/sshfs-win-3.7.21011-x64.msi
        shell: bash
      - name: "Install sshfs"
        shell: powershell
        run: |
          dir
          Start-Process msiexec -Wait -verb runAs -Args "/i winfsp.msi /passive /qn /L*V winfsp-install.log"
          Start-Process msiexec -Wait -verb runAs -Args "/i sshfs-win.msi /passive /qn /L*V sshfs-win-install.log"
          [Environment]::SetEnvironmentVariable("Path", "C:\\;C:\\Program Files\\SSHFS-Win\\bin;$ENV:Path", "Machine")
      - uses: actions/download-artifact@v2
        with:
          name: image
      - run: make build
      - uses: ./.github/actions/prepare-kluster
        with:
          platform: windows
          token: ${{ secrets.DEV_TELEPRESENCE_KUBECEPTION_TOKEN }}
          tel-image: tel2-image.tar
        id: kluster
      - run: |
          # We want to validate that tests still pass, even if the metrics host
          # points to a broken IP
          echo "127.0.0.1 metriton.datawire.io" >> c:\windows\system32\drivers\etc\hosts
        name: Update etc\hosts
      - run: |
          $ENV:DTEST_KUBECONFIG = "${{ steps.kluster.outputs.kubeconfig }}"
          $ENV:DTEST_REGISTRY = "docker.io/datawire"
          $ENV:Path += ".;C:\\Program Files\\SSHFS-Win\\bin"
          make test
        name: Run tests
      - uses: ./.github/actions/upload-logs
        if: always()
      - uses: ./.github/actions/cleanup-kluster
        with:
          platform: windows
          token: ${{ secrets.DEV_TELEPRESENCE_KUBECEPTION_TOKEN }}
        if: always()
  "linux_test":
    runs-on: ubuntu-latest
    needs: "build_image"
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
          ref: "${{ github.event.pull_request.head.sha }}"
      - uses: actions/setup-go@v2
        with:
          go-version: '^1.17.x'
      - uses: azure/setup-kubectl@v1
        with:
          version: 'v1.19.3'
        id: kubectl
      - run: |
          sudo rm -f /etc/apt/sources.list.d/google-chrome.list
          sudo apt-get update
          sudo apt-get install -y sshfs socat
          sudo sh -c 'echo user_allow_other >> /etc/fuse.conf'
        name: install dependencies
      - uses: actions/download-artifact@v2
        with:
          name: image
      - run: make build
      - uses: ./.github/actions/prepare-kluster
        with:
          platform: linux
          token: ${{ secrets.DEV_TELEPRESENCE_KUBECEPTION_TOKEN }}
          tel-image: tel2-image.tar
        id: kluster
      - run: |
          # We want to validate that tests still pass, even if the metrics host
          # points to a broken IP
          echo "127.0.0.1 metriton.datawire.io" | sudo tee -a /etc/hosts
          DTEST_KUBECONFIG="${{ steps.kluster.outputs.kubeconfig }}" DTEST_REGISTRY="docker.io/datawire" make test
        name: Run tests
      - uses: ./.github/actions/upload-logs
        if: always()
      - uses: ./.github/actions/cleanup-kluster
        with:
          platform: linux
          token: ${{ secrets.DEV_TELEPRESENCE_KUBECEPTION_TOKEN }}
        if: always()
<commit_msg>add caching for macos<commit_after>name: "Dev build"
on:
  pull_request_target:
    types:
      - labeled
jobs:
  "build_image":
    runs-on: ubuntu-latest
    if: ${{ github.event.label.name == 'ok to test' }}
    steps:
      - name: Remove label
        uses: andymckay/labeler@master
        with:
          remove-labels: "ok to test"
        if: always()
      - uses: actions/checkout@v2
        with:
          ref: "${{ github.event.pull_request.head.sha }}"
      - uses: actions/setup-go@v2
        with:
          go-version: '^1.17.x'
      - name: Build dev image
        run: |
          TAG="2.4.5-gotest.${GITHUB_SHA:0:7}"
          TELEPRESENCE_VERSION="v${TAG}" make image
          mkdir -p /tmp/workspace
          docker save "datawire/tel2:${TAG}" > tel2-image.tar
      - name: Upload image
        uses: actions/upload-artifact@v2
        with:
          name: image
          path: tel2-image.tar
  "macos_test":
    runs-on: macos-latest
    needs: "build_image"
    steps:
      # Used so we don't have to re-run tests that pass, kinda hacky but github
      # doesn't have any other alternative right now aside from re-running *all* jobs.
      # It is on the roadmap though: https://github.com/github/roadmap/issues/271
      - id: timestamp
        run: echo "::set-output name=timestamp::$(date +%s)"

      - name: Get previous run
        uses: actions/cache@v2
        with:
          path: |
            run_result
          key: ${{ github.run_id }}-${{ github.job }}-${{ steps.timestamp.outputs.timestamp }}
          restore-keys: |
            ${{ github.run_id }}-${{ github.job }}-

      - name: Get result from the previous run
        id: run_result
        run: cat run_result 2>/dev/null || echo 'not run'

      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
          ref: "${{ github.event.pull_request.head.sha }}"
      - uses: actions/setup-go@v2
        with:
          go-version: '^1.17.x'
      - uses: azure/setup-kubectl@v1
        if: steps.run_result.outputs.run_result != 'success'
        with:
          version: 'v1.19.3'
        id: kubectl
      - name: "Test arm64 build"
        if: steps.run_result.outputs.run_result != 'success'
        run: GOARCH=arm64 make build
      - run: make build
        if: steps.run_result.outputs.run_result != 'success'
      - run: |
          brew update
          brew install --cask macfuse
          brew install gromgit/fuse/sshfs-mac
          brew link --overwrite sshfs-mac
        name: install dependencies
        if: steps.run_result.outputs.run_result != 'success'
      - uses: actions/download-artifact@v2
        if: steps.run_result.outputs.run_result != 'success'
        with:
          name: image
      - uses: ./.github/actions/prepare-kluster
        if: steps.run_result.outputs.run_result != 'success'
        with:
          platform: macos
          token: ${{ secrets.DEV_TELEPRESENCE_KUBECEPTION_TOKEN }}
          tel-image: tel2-image.tar
        id: kluster
      - run: |
          # We want to validate that tests still pass, even if the metrics host
          # points to a broken IP
          echo "127.0.0.1 metriton.datawire.io" | sudo tee -a /etc/hosts
          DTEST_KUBECONFIG="${{ steps.kluster.outputs.kubeconfig }}" DTEST_REGISTRY="docker.io/datawire" make test
        name: Run tests
        if: steps.run_result.outputs.run_result != 'success'
      - name: Mark test as successful
        run: echo "::set-output name=run_result::success" > run_result
      - uses: ./.github/actions/upload-logs
        if: always()
      - uses: ./.github/actions/cleanup-kluster
        with:
          platform: macos
          token: ${{ secrets.DEV_TELEPRESENCE_KUBECEPTION_TOKEN }}
        if: always()

  "windows_test":
    runs-on: windows-2019
    needs: "build_image"
    steps:
      # Used so we don't have to re-run tests that pass, kinda hacky but github
      # doesn't have any other alternative right now aside from re-running *all* jobs.
      # It is on the roadmap though: https://github.com/github/roadmap/issues/271
      - id: timestamp
        run: echo "::set-output name=timestamp::$(date +%s)"

      - name: Get previous run
        uses: actions/cache@v2
        with:
          path: |
            run_result
          key: ${{ github.run_id }}-${{ github.job }}-${{ steps.timestamp.outputs.timestamp }}
          restore-keys: |
            ${{ github.run_id }}-${{ github.job }}-

      - name: Get result from the previous run
        shell: bash
        id: run_result
        run: cat run_result 2> /dev/null || echo 'not run'

      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
          ref: "${{ github.event.pull_request.head.sha }}"
      - uses: actions/setup-go@v2
        with:
          go-version: '^1.17.x'
      - uses: azure/setup-kubectl@v1
        if: steps.run_result.outputs.run_result != 'success'
        with:
          version: 'v1.19.3'
        id: kubectl
      - run: |
          choco install make
          mkdir -p build-output/bin
          curl.exe -LO https://www.wintun.net/builds/wintun-0.12.zip
          Expand-Archive -Path wintun-0.12.zip -DestinationPath .
          #cp wintun/bin/amd64/wintun.dll "$ENV:SystemRoot\\system32\\wintun.dll"
          #cp wintun/bin/amd64/wintun.dll .
          cp wintun/bin/amd64/wintun.dll "build-output\\bin"
        if: steps.run_result.outputs.run_result != 'success'
        name: install dependencies
      - name: "Download sshfs"
        if: steps.run_result.outputs.run_result != 'success'
        run: |
          curl -L -o winfsp.msi https://github.com/billziss-gh/winfsp/releases/download/v1.9/winfsp-1.9.21096.msi
          curl -L -o sshfs-win.msi https://github.com/billziss-gh/sshfs-win/releases/download/v3.7.21011/sshfs-win-3.7.21011-x64.msi
        shell: bash
      - name: "Install sshfs"
        if: steps.run_result.outputs.run_result != 'success'
        shell: powershell
        run: |
          dir
          Start-Process msiexec -Wait -verb runAs -Args "/i winfsp.msi /passive /qn /L*V winfsp-install.log"
          Start-Process msiexec -Wait -verb runAs -Args "/i sshfs-win.msi /passive /qn /L*V sshfs-win-install.log"
          [Environment]::SetEnvironmentVariable("Path", "C:\\;C:\\Program Files\\SSHFS-Win\\bin;$ENV:Path", "Machine")
      - uses: actions/download-artifact@v2
        if: steps.run_result.outputs.run_result != 'success'
        with:
          name: image
      - run: make build
        if: steps.run_result.outputs.run_result != 'success'
      - uses: ./.github/actions/prepare-kluster
        if: steps.run_result.outputs.run_result != 'success'
        with:
          platform: windows
          token: ${{ secrets.DEV_TELEPRESENCE_KUBECEPTION_TOKEN }}
          tel-image: tel2-image.tar
        id: kluster
      - run: |
          # We want to validate that tests still pass, even if the metrics host
          # points to a broken IP
          echo "127.0.0.1 metriton.datawire.io" >> c:\windows\system32\drivers\etc\hosts
        if: steps.run_result.outputs.run_result != 'success'
        name: Update etc\hosts
      - run: |
          $ENV:DTEST_KUBECONFIG = "${{ steps.kluster.outputs.kubeconfig }}"
          $ENV:DTEST_REGISTRY = "docker.io/datawire"
          $ENV:Path += ".;C:\\Program Files\\SSHFS-Win\\bin"
          make test
        if: steps.run_result.outputs.run_result != 'success'
        name: Run tests
      - name: Mark test as successful
        run: echo "::set-output name=run_result::success" > run_result
      - uses: ./.github/actions/upload-logs
        if: always()
      - uses: ./.github/actions/cleanup-kluster
        with:
          platform: windows
          token: ${{ secrets.DEV_TELEPRESENCE_KUBECEPTION_TOKEN }}
        if: always()
  "linux_test":
    runs-on: ubuntu-latest
    needs: "build_image"
    steps:
      # Used so we don't have to re-run tests that pass, kinda hacky but github
      # doesn't have any other alternative right now aside from re-running *all* jobs.
      # It is on the roadmap though: https://github.com/github/roadmap/issues/271
      - id: timestamp
        run: echo "::set-output name=timestamp::$(date +%s)"

      - name: Get previous run
        uses: actions/cache@v2
        with:
          path: |
            run_result
          key: ${{ github.run_id }}-${{ github.job }}-${{ steps.timestamp.outputs.timestamp }}
          restore-keys: |
            ${{ github.run_id }}-${{ github.job }}-

      - name: Get result from the previous run
        id: run_result
        run: cat run_result 2>/dev/null || echo 'not run'

      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
          ref: "${{ github.event.pull_request.head.sha }}"
      - uses: actions/setup-go@v2
        with:
          go-version: '^1.17.x'
      - uses: azure/setup-kubectl@v1
        if: steps.run_result.outputs.run_result != 'success'
        with:
          version: 'v1.19.3'
        id: kubectl
      - run: |
          sudo rm -f /etc/apt/sources.list.d/google-chrome.list
          sudo apt-get update
          sudo apt-get install -y sshfs socat
          sudo sh -c 'echo user_allow_other >> /etc/fuse.conf'
        if: steps.run_result.outputs.run_result != 'success'
        name: install dependencies
      - uses: actions/download-artifact@v2
        if: steps.run_result.outputs.run_result != 'success'
        with:
          name: image
      - run: make build
        if: steps.run_result.outputs.run_result != 'success'
      - uses: ./.github/actions/prepare-kluster
        if: steps.run_result.outputs.run_result != 'success'
        with:
          platform: linux
          token: ${{ secrets.DEV_TELEPRESENCE_KUBECEPTION_TOKEN }}
          tel-image: tel2-image.tar
        id: kluster
      - run: |
          # We want to validate that tests still pass, even if the metrics host
          # points to a broken IP
          echo "127.0.0.1 metriton.datawire.io" | sudo tee -a /etc/hosts
          DTEST_KUBECONFIG="${{ steps.kluster.outputs.kubeconfig }}" DTEST_REGISTRY="docker.io/datawire" make test
        if: steps.run_result.outputs.run_result != 'success'
        name: Run tests
      - name: Mark test as successful
        run: echo "::set-output name=run_result::success" > run_result
      - uses: ./.github/actions/upload-logs
        if: always()
      - uses: ./.github/actions/cleanup-kluster
        with:
          platform: linux
          token: ${{ secrets.DEV_TELEPRESENCE_KUBECEPTION_TOKEN }}
        if: always()

{'fraction_non_alphanumeric': 0.12314298978644382, 'fraction_numerical': 0.014798050139275766, 'mean_word_length': 1.8827367012378722, 'pattern_counts': {'":': 14, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 9, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1329103', 'n_tokens_mistral': 5824, 'n_tokens_neox': 5555, 'n_words': 1252}