Skip to content

Commit

Permalink
use caching in github actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
friedrichwilken committed Dec 19, 2023
1 parent ee97c1a commit 2a29c0a
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 30 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/pull-with-lifecycle-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ env:

on:
pull_request:
branches: [ "main" ]
branches: ["main"]
paths-ignore:
- 'docs/**'
- '**.md'
- 'sec-scanners-config.yaml'
- "docs/**"
- "**.md"
- "sec-scanners-config.yaml"

jobs:
e2e:
Expand All @@ -21,6 +21,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Cache Go dependencies
uses: actions/setup-go@v5
with:
go-version-file: "./go.mod"

- name: Install k3d tools
run: |
make -C hack/ci/ install-k3d-tools
Expand Down
27 changes: 12 additions & 15 deletions .github/workflows/pull-without-lifecycle-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ env:

on:
pull_request:
branches: [ "main" ]
branches: ["main"]
paths-ignore:
- 'docs/**'
- '**.md'
- 'sec-scanners-config.yaml'
- "docs/**"
- "**.md"
- "sec-scanners-config.yaml"

jobs:
e2e:
Expand All @@ -24,9 +24,7 @@ jobs:
- name: Cache Go dependencies
uses: actions/setup-go@v5
with:
go-version-file: './go.mod'
check-latest: true
cache-dependency-path: './go.sum'
go-version-file: "./go.mod"

- name: Install k3d tools
run: |
Expand Down Expand Up @@ -82,36 +80,35 @@ jobs:
run: |
make e2e-cleanup
# the following steps only run on failure to help finding the cause of the failure
# the following steps only run on failure to help finding the cause of the failure

- name: List CRDs
if: failure()
if: failure()
run: |
kubectl get crd
- name: List Namespaces
if: failure()
if: failure()
run: |
kubectl get namespaces
- name: List StatefulSets
if: failure()
if: failure()
run: |
kubectl get sts --all-namespaces
- name: List Pods
if: failure()
if: failure()
run: |
kubectl get po --all-namespaces
- name: List PVCs
if: failure()
if: failure()
run: |
kubectl get pvc --all-namespaces
- name: List NATS CR
if: failure()
if: failure()
run: |
kubectl get nats --all-namespaces
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/push-with-lifecycle-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ env:

on:
push:
branches: [ "main" ]
branches: ["main"]
paths-ignore:
- 'docs/**'
- '**.md'
- 'sec-scanners-config.yaml'
- "docs/**"
- "**.md"
- "sec-scanners-config.yaml"

jobs:
e2e:
Expand All @@ -21,6 +21,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Cache Go dependencies
uses: actions/setup-go@v5
with:
go-version-file: "./go.mod"

- name: Install k3d tools
run: |
make -C hack/ci/ install-k3d-tools
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test.yml → .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ on:
branches:
- main
paths-ignore:
- 'docs/**'
- '**.md'
- 'sec-scanners-config.yaml'
- "docs/**"
- "**.md"
- "sec-scanners-config.yaml"

push:
branches:
- main
paths-ignore:
- 'docs/**'
- '**.md'
- 'sec-scanners-config.yaml'
- "docs/**"
- "**.md"
- "sec-scanners-config.yaml"

permissions:
contents: read
Expand All @@ -32,7 +32,7 @@ jobs:
- name: Cache Go dependencies
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version-file: "./go.mod"

- name: Execute unit test
run: make test

0 comments on commit 2a29c0a

Please sign in to comment.