Skip to content

Commit d173dd2

Browse files
committed
attest test
1 parent 92eae0b commit d173dd2

File tree

2 files changed

+124
-77
lines changed

2 files changed

+124
-77
lines changed

.github/workflows/ci.yaml

Lines changed: 80 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -24,85 +24,88 @@ jobs:
2424
exit 1
2525
fi
2626
27-
clippy_check:
28-
name: Linter Check
29-
runs-on: ubuntu-latest
30-
steps:
31-
- uses: actions/checkout@v4
32-
- uses: dtolnay/[email protected]
33-
with:
34-
components: clippy
35-
- name: Install Protocol Buffers Compiler
36-
run: sudo apt-get install -y protobuf-compiler
37-
- name: Set PROTOC Environment Variable
38-
run: export PROTOC=/path/to/protoc
39-
- name: Run Clippy
40-
run: cargo clippy
41-
- name: Run Clippy
42-
run: cargo clippy --package holo-tools
27+
#clippy_check:
28+
# name: Linter Check
29+
# runs-on: ubuntu-latest
30+
# steps:
31+
# - uses: actions/checkout@v4
32+
# - uses: dtolnay/[email protected]
33+
# with:
34+
# components: clippy
35+
# - name: Install Protocol Buffers Compiler
36+
# run: sudo apt-get install -y protobuf-compiler
37+
# - name: Set PROTOC Environment Variable
38+
# run: export PROTOC=/path/to/protoc
39+
# - name: Run Clippy
40+
# run: cargo clippy
41+
# - name: Run Clippy
42+
# run: cargo clippy --package holo-tools
4343

44-
tests_and_coverage_report:
45-
name: Tests and Coverage Report
46-
runs-on: ubuntu-latest
47-
steps:
48-
- uses: actions/checkout@v4
49-
- uses: dtolnay/[email protected]
50-
- name: Install cargo-llvm-cov
51-
uses: taiki-e/install-action@cargo-llvm-cov
52-
- name: Generate code coverage
53-
run: cargo llvm-cov --all-features --codecov --output-path codecov.json -p holo-bfd -p holo-bgp -p holo-isis -p holo-ldp -p holo-ospf -p holo-rip -p holo-vrrp
54-
- name: Upload to Codecov
55-
uses: codecov/codecov-action@v4
56-
if: github.event_name != 'pull_request'
57-
with:
58-
files: ./lcov.info
59-
fail_ci_if_error: false
60-
token: ${{ secrets.CODECOV_TOKEN }}
44+
#tests_and_coverage_report:
45+
# name: Tests and Coverage Report
46+
# runs-on: ubuntu-latest
47+
# steps:
48+
# - uses: actions/checkout@v4
49+
# - uses: dtolnay/[email protected]
50+
# - name: Install cargo-llvm-cov
51+
# uses: taiki-e/install-action@cargo-llvm-cov
52+
# - name: Generate code coverage
53+
# run: cargo llvm-cov --all-features --codecov --output-path codecov.json -p holo-bfd -p holo-bgp -p holo-isis -p holo-ldp -p holo-ospf -p holo-rip -p holo-vrrp
54+
# - name: Upload to Codecov
55+
# uses: codecov/codecov-action@v4
56+
# if: github.event_name != 'pull_request'
57+
# with:
58+
# files: ./lcov.info
59+
# fail_ci_if_error: false
60+
# token: ${{ secrets.CODECOV_TOKEN }}
6161

62-
tests_arm:
63-
name: Tests (Arm64)
64-
runs-on: ubuntu-24.04-arm
65-
steps:
66-
- uses: actions/checkout@v4
67-
- uses: dtolnay/[email protected]
68-
- name: Run tests
69-
run: cargo test --all-features -p holo-bfd -p holo-bgp -p holo-isis -p holo-ldp -p holo-ospf -p holo-rip -p holo-vrrp
62+
#tests_arm:
63+
# name: Tests (Arm64)
64+
# runs-on: ubuntu-24.04-arm
65+
# steps:
66+
# - uses: actions/checkout@v4
67+
# - uses: dtolnay/[email protected]
68+
# - name: Run tests
69+
# run: cargo test --all-features -p holo-bfd -p holo-bgp -p holo-isis -p holo-ldp -p holo-ospf -p holo-rip -p holo-vrrp
7070

71-
fuzz-build-check:
72-
name: Check fuzz targets build
73-
runs-on: ubuntu-latest
74-
steps:
75-
- uses: actions/checkout@v4
76-
# cargo-fuzz requires nightly Rust due to LLVM sanitizer support
77-
- uses: dtolnay/rust-toolchain@nightly
78-
- name: Install cargo-fuzz
79-
run: cargo install cargo-fuzz
80-
- name: Check fuzz targets
81-
run: cargo fuzz check
71+
#fuzz-build-check:
72+
# name: Check fuzz targets build
73+
# runs-on: ubuntu-latest
74+
# steps:
75+
# - uses: actions/checkout@v4
76+
# # cargo-fuzz requires nightly Rust due to LLVM sanitizer support
77+
# - uses: dtolnay/rust-toolchain@nightly
78+
# - name: Install cargo-fuzz
79+
# run: cargo install cargo-fuzz
80+
# - name: Check fuzz targets
81+
# run: cargo fuzz check
8282

83-
bench-build-check:
84-
name: Check benchmark builds
85-
runs-on: ubuntu-latest
86-
steps:
87-
- uses: actions/checkout@v4
88-
- uses: dtolnay/[email protected]
89-
- name: Check benchmark builds
90-
run: cargo bench --no-run -p holo-bgp -p holo-ldp -p holo-ospf
83+
#bench-build-check:
84+
# name: Check benchmark builds
85+
# runs-on: ubuntu-latest
86+
# steps:
87+
# - uses: actions/checkout@v4
88+
# - uses: dtolnay/[email protected]
89+
# - name: Check benchmark builds
90+
# run: cargo bench --no-run -p holo-bgp -p holo-ldp -p holo-ospf
9191

92-
push-image:
93-
name: Docker Image Build
94-
runs-on: ubuntu-latest
95-
if: github.ref == 'refs/heads/master' && github.repository_owner == 'holo-routing'
96-
steps:
97-
- uses: actions/checkout@v4
98-
- uses: docker/login-action@v3
99-
with:
100-
registry: ghcr.io
101-
username: ${{github.actor}}
102-
password: ${{secrets.GITHUB_TOKEN}}
103-
- name: Build and push container image
104-
run: |
105-
docker build . -f docker/Dockerfile.holod --tag ghcr.io/holo-routing/holod:latest
106-
docker push ghcr.io/holo-routing/holod:latest
107-
docker build . -f docker/Dockerfile.holo-bundle --tag ghcr.io/holo-routing/holo-bundle:latest
108-
docker push ghcr.io/holo-routing/holo-bundle:latest
92+
docker-build-holod:
93+
uses: .github/workflows/docker-build-and-attest.yml
94+
with:
95+
image-name: holod
96+
dockerfile: docker/Dockerfile.holod
97+
permissions:
98+
id-token: write
99+
attestations: write
100+
packages: write
101+
102+
docker-build-holo-bundle:
103+
needs: docker-build-holod
104+
uses: .github/workflows/docker-build-and-attest.yml
105+
with:
106+
image-name: holo-bundle
107+
dockerfile: docker/Dockerfile.holo-bundle
108+
permissions:
109+
id-token: write
110+
attestations: write
111+
packages: write
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build and Attest Docker Image
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
image-name:
7+
required: true
8+
type: string
9+
dockerfile:
10+
required: true
11+
type: string
12+
13+
jobs:
14+
build-and-attest:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
id-token: write
18+
attestations: write
19+
packages: write
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Login to GitHub Container Registry
24+
uses: docker/login-action@v3
25+
with:
26+
registry: ghcr.io
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Build and push image
31+
id: push_image
32+
uses: docker/build-push-action@v6
33+
with:
34+
context: .
35+
file: ${{ inputs.dockerfile }}
36+
push: true
37+
tags: ghcr.io/holo-routing/${{ inputs.image-name }}:latest
38+
39+
- name: Attest image
40+
uses: actions/attest-build-provenance@v2
41+
with:
42+
subject-name: ghcr.io/holo-routing/${{ inputs.image-name }}
43+
subject-digest: ${{ steps.push_image.outputs.digest }}
44+
push-to-registry: true

0 commit comments

Comments
 (0)