-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: zhaque44 <[email protected]>
- Loading branch information
Showing
1 changed file
with
31 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,27 +9,46 @@ on: | |
jobs: | ||
|
||
build-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: 'go.mod' | ||
cache: true | ||
- name: Cache Go modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: build | ||
run: make build | ||
|
||
unit-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
SKIP_TESTS: true | ||
steps: | ||
- name: Create k8s Kind Cluster | ||
if: ${{ matrix.os == 'ubuntu-latest' }} # Only runs on Ubuntu | ||
uses: helm/[email protected] | ||
with: | ||
cluster_name: cluster | ||
- name: Set k8s provider | ||
if: ${{ matrix.os == 'ubuntu-latest' }} # Only runs on Ubuntu | ||
run: | | ||
kubectl create namespace test-namespace | ||
kubectl create secret generic mysecret -n test-namespace --from-literal=key=p4ssw0rd | ||
|
@@ -40,5 +59,14 @@ jobs: | |
with: | ||
go-version-file: 'go.mod' | ||
cache: true | ||
- name: Cache Go modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: test | ||
run: make test | ||
run: make test |