Skip to content

Commit

Permalink
Merge pull request #474 from spegel-org/refactor/github-actions
Browse files Browse the repository at this point in the history
Refactor GitHub actions to only trigger on specific file changes
  • Loading branch information
phillebaba authored May 13, 2024
2 parents b25b142 + b3647d0 commit 6b84339
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 74 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/artifacthub.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
name: artifacthub

on:
push:
branches: ["main"]
paths: ["charts/spegel/artifacthub-repo.yml"]

paths:
- "charts/spegel/artifacthub-repo.yml"
permissions:
contents: read
packages: write

jobs:
release:
runs-on: ubuntu-latest
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: e2e
on:
pull_request:
paths:
- "**.go"
- "go.mod"
- "go.sum"
- "Dockerfile"
- "test/**"
- "charts/**"
jobs:
test:
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
cni: [iptables, iptables-ipv6, ipvs]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Run e2e
run: make e2e CNI=${{ matrix.cni }}
35 changes: 35 additions & 0 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: go
on:
pull_request:
paths:
- "**.go"
- "go.mod"
- "go.sum"
- ".golangci.yaml"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Setup golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.58.0
args: --timeout 3m0s
unit:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Run tests
run: make test
25 changes: 25 additions & 0 deletions .github/workflows/helm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: helm
on:
pull_request:
paths:
- "charts/**"
jobs:
docs:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Run helm-docs
run: make helm-docs
- name: Check if working tree is dirty
run: |
if [[ $(git diff --stat) != '' ]]; then
git diff
echo 'run make helm-docs and commit changes'
exit 1
fi
3 changes: 0 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
name: release

on:
release:
types: [published]

permissions:
contents: read
packages: write
id-token: write

jobs:
release:
runs-on: ubuntu-latest
Expand Down
67 changes: 0 additions & 67 deletions .github/workflows/tests.yaml

This file was deleted.

0 comments on commit 6b84339

Please sign in to comment.