|
| 1 | +# todo: remove this file when go/v2 be removed |
| 2 | +name: Unit tests Legacy (go/v2) |
| 3 | + |
| 4 | +# Trigger the workflow on pull requests and direct pushes to any branch |
| 5 | +on: |
| 6 | + push: |
| 7 | + pull_request: |
| 8 | + |
| 9 | +jobs: |
| 10 | + test: |
| 11 | + name: ${{ matrix.os }} |
| 12 | + runs-on: ${{ matrix.os }} |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + os: |
| 16 | + - ubuntu-latest |
| 17 | + - macos-latest |
| 18 | + # Pull requests from the same repository won't trigger this checks as they were already triggered by the push |
| 19 | + if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) |
| 20 | + steps: |
| 21 | + - name: Clone the code |
| 22 | + uses: actions/checkout@v2 |
| 23 | + - name: Setup Go |
| 24 | + uses: actions/setup-go@v2 |
| 25 | + with: |
| 26 | + # the go/v2 cannot be updated and is scaffold with golang 1.13 |
| 27 | + # (version used by its dep version of the controller-runtime) |
| 28 | + # however, we are unable to downgrade the version here |
| 29 | + # because we will face errors |
| 30 | + # So we are keeping the latest version where it works |
| 31 | + # and highlighting that must be fixed |
| 32 | + # Therefore, we probably will deprecate go/v2 soon since we cannot upgrade it |
| 33 | + # to use the versions of controller-runtime > v0.9 |
| 34 | + # and controller-tools > v0.6 as k8s > 1.21 then it might not be valid we spend effort on this fix |
| 35 | + go-version: "1.17" |
| 36 | + # This step is needed as the following one tries to remove |
| 37 | + # kustomize for each test but has no permission to do so |
| 38 | + - name: Remove pre-installed kustomize |
| 39 | + run: sudo rm -f /usr/local/bin/kustomize |
| 40 | + - name: Perform the test |
| 41 | + run: make test-legacy |
| 42 | + - name: Report failure |
| 43 | + uses: nashmaniac/[email protected] |
| 44 | + # Only report failures of pushes (PRs have are visible through the Checks section) to the default branch |
| 45 | + if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/master' |
| 46 | + with: |
| 47 | + title: 🐛 Unit tests failed on ${{ matrix.os }} for ${{ github.sha }} |
| 48 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 49 | + labels: kind/bug |
| 50 | + body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |
0 commit comments