Skip to content

Commit e3aefda

Browse files
committed
feat(ci): add E2E tests and Dependabot configuration
Signed-off-by: SequeI <[email protected]>
1 parent e9cb175 commit e3aefda

File tree

5 files changed

+78
-36
lines changed

5 files changed

+78
-36
lines changed

.github/dependabot.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gomod"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
open-pull-requests-limit: 10
8+
groups:
9+
go-modules:
10+
patterns:
11+
- "*"
12+
pull-request-title:
13+
prefix: "chore(deps)"
14+
separator: " "
15+
labels:
16+
- "dependencies"
17+
- "go"
18+
19+
- package-ecosystem: "github-actions"
20+
directory: "/"
21+
schedule:
22+
interval: "weekly"
23+
open-pull-requests-limit: 10
24+
groups:
25+
actions-updates:
26+
patterns:
27+
- "*"
28+
update-types:
29+
- "patch"
30+
- "minor"
31+
- "major"
32+
pull-request-title:
33+
prefix: "chore(deps-dev)"
34+
separator: " "
35+
labels:
36+
- "dependencies"
37+
- "github-actions"

.github/workflows/lint.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,35 @@
1-
name: Lint
1+
name: Linter
22

33
on:
44
push:
5+
branches: [ "main" ]
56
pull_request:
7+
branches: [ "main" ]
8+
9+
permissions:
10+
contents: read
611

712
jobs:
813
lint:
9-
name: Run on Ubuntu
14+
name: Run Linting
1015
runs-on: ubuntu-latest
16+
1117
steps:
12-
- name: Clone the code
18+
- name: Checkout code
1319
uses: actions/checkout@v4
1420

1521
- name: Setup Go
1622
uses: actions/setup-go@v5
1723
with:
1824
go-version-file: go.mod
25+
cache: true
26+
27+
- name: Go mod tidy
28+
run: go mod tidy
1929

20-
- name: Run linter
30+
- name: Run golangci-lint
2131
uses: golangci/golangci-lint-action@v8
2232
with:
2333
version: v2.3.0
34+
args: --timeout=5m --issues-exit-code=0 --verbose
35+
cache: true

.github/workflows/sign-model.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Sign Model Tensorflow Saved Model
1+
name: Sign model with Sigstore
22

33
on:
44
workflow_dispatch:
@@ -27,18 +27,20 @@ jobs:
2727
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=sigstore" | jq -r '.value')
2828
echo "OIDC_TOKEN=$token" >> $GITHUB_ENV
2929
30-
- name: Set up environment and sign model
30+
- name: Sign model
3131
env:
3232
OIDC_TOKEN: ${{ env.OIDC_TOKEN }}
3333
run: |
34-
docker run --rm -v $(pwd)/testdata/tensorflow_saved_model:/tensorflow_saved_model:z -w /tensorflow_saved_model ghcr.io/sigstore/model-transparency-cli:v1.0.1 sign sigstore --signature="/tensorflow_saved_model/model.sig" --identity_token "$OIDC_TOKEN" /tensorflow_saved_model
34+
docker run --rm -v $(pwd)/testdata/tensorflow_saved_model:/tensorflow_saved_model:z -w \
35+
/tensorflow_saved_model ghcr.io/sigstore/model-transparency-cli:v1.0.1 sign sigstore \
36+
--signature="/tensorflow_saved_model/model.sig" --identity_token "$OIDC_TOKEN" /tensorflow_saved_model
3537
36-
- name: Create tar.gz of the signed model
38+
- name: Create a tarball of the signed model and signature
3739
run: |
38-
tar -czvf signed_model.tar.gz -C $(pwd)/testdata/tensorflow_saved_model .
40+
tar -czvf signed_model_bundle.tar.gz -C $(pwd)/testdata/tensorflow_saved_model .
3941
40-
- name: Upload signed model as artifact
42+
- name: Upload signed model artifact
4143
uses: actions/upload-artifact@v4
4244
with:
43-
name: signed-model
44-
path: signed_model.tar.gz
45+
name: signed-model-bundle
46+
path: signed_model_bundle.tar.gz

.github/workflows/test-e2e.yml

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,39 @@ name: E2E Tests
22

33
on:
44
push:
5+
branches: [ "main" ]
56
pull_request:
7+
branches: [ "main" ]
8+
9+
permissions:
10+
contents: read
611

712
jobs:
813
test-e2e:
9-
name: Run on Ubuntu
14+
name: Run E2E Tests
1015
runs-on: ubuntu-latest
1116
steps:
12-
- name: Clone the code
17+
- name: Checkout code
1318
uses: actions/checkout@v4
1419

1520
- name: Setup Go
1621
uses: actions/setup-go@v5
1722
with:
1823
go-version-file: go.mod
19-
20-
- name: Install the latest version of kind
21-
run: |
22-
curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64
23-
chmod +x ./kind
24-
sudo mv ./kind /usr/local/bin/kind
25-
26-
- name: Verify kind installation
27-
run: kind version
28-
29-
- name: Install kubectl
30-
run: |
31-
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
32-
chmod +x kubectl
33-
sudo mv kubectl /usr/local/bin/kubectl
34-
35-
- name: Verify kubectl installation
36-
run: kubectl version --client
24+
cache: true
3725

3826
- name: Create kind cluster
39-
run: kind create cluster
27+
uses: helm/kind-action@v1
28+
with:
29+
cluster_name: kind
4030

41-
- name: Wait for cluster to be ready
31+
- name: Wait for kind cluster to be ready
4232
run: |
43-
echo "Waiting for cluster to be ready..."
4433
kubectl wait --for=condition=Ready nodes --all --timeout=300s
4534
kubectl wait --for=condition=Ready --namespace=kube-system pod --all --timeout=300s
4635
echo "Cluster is ready"
4736
48-
- name: Running Test e2e
37+
- name: Run E2E tests
4938
run: |
5039
go mod tidy
5140
make test-e2e

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ name: Tests
22

33
on:
44
push:
5+
branches: [ "main" ]
56
pull_request:
7+
branches: [ "main" ]
68

79
jobs:
810
test:

0 commit comments

Comments
 (0)