From 14da91de02cd1546eb6006a565f9232fb4d67e48 Mon Sep 17 00:00:00 2001 From: Micah Hausler Date: Fri, 8 Nov 2024 11:07:10 -0600 Subject: [PATCH] Fix action cache --- .github/workflows/cedar-validation.yaml | 21 ++++++++++++++++++--- .github/workflows/golangci-lint.yaml | 2 +- .github/workflows/unit-tests.yaml | 6 +++--- internal/schema/convert/openapi.go | 1 - 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cedar-validation.yaml b/.github/workflows/cedar-validation.yaml index 071b60e..bee869c 100644 --- a/.github/workflows/cedar-validation.yaml +++ b/.github/workflows/cedar-validation.yaml @@ -13,16 +13,31 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Restore cached crates + id: cargo-cache-restore + uses: actions/cache/restore@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + ~/.cargo/.crates.toml + ~/.cargo/.crates2.json + key: ${{ runner.os }}-cargo-cedar-${{env.CEDAR_VERSION}} - name: Install cedar-cli run: cargo install cedar-policy-cli@${{env.CEDAR_VERSION}} - - uses: actions/cache@v4 + - name: Save cached crates + id: cargo-cache-save + uses: actions/cache/save@v4 with: path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{env.CEDAR_VERSION}} + ~/.cargo/.crates.toml + ~/.cargo/.crates2.json + key: ${{ runner.os }}-cargo-cedar-${{env.CEDAR_VERSION}} - name: Validate Policies run: make validate-policies diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index b0330a7..a9de400 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -1,4 +1,4 @@ -name: golangci-lint +name: Lint on: push: branches: diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index cd87df6..485540f 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -1,4 +1,4 @@ -name: unit tests +name: Test and Build on: push: branches: [ main ] @@ -13,9 +13,9 @@ jobs: go-version: [ '1.23' ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Go ${{ matrix.go-version }} - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} diff --git a/internal/schema/convert/openapi.go b/internal/schema/convert/openapi.go index 73f0542..df4253c 100644 --- a/internal/schema/convert/openapi.go +++ b/internal/schema/convert/openapi.go @@ -507,7 +507,6 @@ func parseCRDProperties(depth int, properties map[string]spec.Schema) (map[strin continue } - // klog.V(2).Infof("Skipping %s attr %s object", k, v.Type[0]) if v.Properties != nil { attrs, err := parseCRDProperties(depth-1, v.Properties) if err != nil {