From be01305b9e18b38e3a79f96612dab1761ad54ead Mon Sep 17 00:00:00 2001 From: Michal Jura Date: Fri, 5 Jan 2024 09:17:40 +0100 Subject: [PATCH 1/2] Add unit test workflow for CI --- .github/workflows/unit.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/unit.yaml diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml new file mode 100644 index 00000000..1ee8147f --- /dev/null +++ b/.github/workflows/unit.yaml @@ -0,0 +1,26 @@ +name: Unit tests +on: + pull_request: + push: + branches: + - main +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Go + uses: actions/setup-go@v4 + with: + go-version: 1.20.x + - uses: actions/cache@v3.3.2 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: ${{ runner.os }}-test-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-test-go-${{ hashFiles('**/go.sum') }} + - name: Run tests + run: | + make test From d806aeb81791632c4234792cf263968e2fce91ec Mon Sep 17 00:00:00 2001 From: Michal Jura Date: Fri, 5 Jan 2024 12:06:08 +0100 Subject: [PATCH 2/2] Fix main branch name in workflows --- .github/workflows/build.yaml | 2 +- .github/workflows/lint.yaml | 2 +- .github/workflows/scan.yaml | 2 +- .github/workflows/update-rancher-charts.yaml | 2 +- .github/workflows/update-rancher-dep.yaml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 90a0bf4a..5fd5c3c2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -3,7 +3,7 @@ on: pull_request: push: branches: - - master + - main jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 4643a49e..e685e733 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -3,7 +3,7 @@ on: pull_request: push: branches: - - master + - main tags: - 'v*' jobs: diff --git a/.github/workflows/scan.yaml b/.github/workflows/scan.yaml index 46f3b2cf..c7e415de 100644 --- a/.github/workflows/scan.yaml +++ b/.github/workflows/scan.yaml @@ -3,7 +3,7 @@ on: pull_request: push: branches: - - master + - main tags: - "v*" jobs: diff --git a/.github/workflows/update-rancher-charts.yaml b/.github/workflows/update-rancher-charts.yaml index 5956a396..f1fb1b48 100644 --- a/.github/workflows/update-rancher-charts.yaml +++ b/.github/workflows/update-rancher-charts.yaml @@ -5,7 +5,7 @@ on: ref: description: "Branch to use for GitHub action workflow" required: true - default: "master" + default: "main" operator_path: description: "Operator github repo for the workflow" required: true diff --git a/.github/workflows/update-rancher-dep.yaml b/.github/workflows/update-rancher-dep.yaml index 19f32c13..919f6a1a 100644 --- a/.github/workflows/update-rancher-dep.yaml +++ b/.github/workflows/update-rancher-dep.yaml @@ -5,7 +5,7 @@ on: ref: description: "Branch to use for GitHub action workflow" required: true - default: "master" + default: "main" rancher_ref: description: "Submit PR against the following rancher/rancher branch (e.g. release/v2.7)" required: true