Skip to content

Commit

Permalink
Provide a util method to get the certs in the system (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
Itxaka authored Apr 17, 2024
1 parent 350c251 commit d729cc7
Show file tree
Hide file tree
Showing 7 changed files with 552 additions and 58 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/secscan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Security Scan"

# Run workflow each time code is pushed to your repository and on a schedule.
# The scheduled workflow runs every at 00:00 on Sunday UTC time.
on:
push:
schedule:
- cron: '0 0 * * 0'

jobs:
tests:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- name: Checkout Source
uses: actions/checkout@v3
- name: Run Gosec Security Scanner
uses: securego/gosec@master
with:
# we let the report trigger content trigger a failure using the GitHub Security features.
args: '-no-fail -fmt sarif -out results.sarif ./...'
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
with:
# Path to SARIF file relative to the root of the repository
sarif_file: results.sarif
30 changes: 22 additions & 8 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,13 @@ concurrency:
env:
FORCE_COLOR: 1
jobs:
unit-tests:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '^1.20'
- name: Install earthly
uses: Luet-lab/luet-install-action@v1
with:
Expand All @@ -29,10 +25,28 @@ jobs:
- name: Run lint
run: |
earthly +lint
unit-tests:
strategy:
matrix:
# Match this version to the maintained FIPS version in packages at https://github.com/kairos-io/packages/blob/main/packages/toolchain-go/collection.yaml#L63
go-version: [ "1.19.10", "1.20", "1.21" ]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install earthly
uses: Luet-lab/luet-install-action@v1
with:
repository: quay.io/kairos/packages
packages: utils/earthly
- name: Run tests
run: |
earthly +test
earthly -P +test --GO_VERSION=${{ matrix.go-version }}
- name: Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: ./coverage.out
12 changes: 10 additions & 2 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,20 @@ luet:
FROM quay.io/luet/base:$LUET_VERSION
SAVE ARTIFACT /usr/bin/luet /luet

test:
go-deps:
ARG GO_VERSION
FROM golang:$GO_VERSION-alpine
WORKDIR /build
COPY +luet/luet /usr/bin/luet
COPY go.mod go.sum ./
RUN go mod download
SAVE ARTIFACT go.mod AS LOCAL go.mod
SAVE ARTIFACT go.sum AS LOCAL go.sum

test:
FROM +go-deps
ENV CGO_ENABLED=0
WORKDIR /build
COPY +luet/luet /usr/bin/luet
COPY . .
RUN go run github.com/onsi/ginkgo/v2/ginkgo run --fail-fast --slow-spec-threshold 30s --covermode=atomic --coverprofile=coverage.out -p -r ./...
SAVE ARTIFACT coverage.out AS LOCAL coverage.out
Expand Down
22 changes: 15 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
module github.com/kairos-io/kairos-sdk

go 1.20
go 1.19

// This versions require go1.20
replace (
github.com/onsi/ginkgo/v2 v2.17.1 => github.com/onsi/ginkgo/v2 v2.12.1
github.com/onsi/gomega v1.32.0 => github.com/onsi/gomega v1.28.0
)

require (
github.com/avast/retry-go v2.7.0+incompatible
github.com/containerd/containerd v1.7.11
github.com/containerd/containerd v1.7.6
github.com/denisbrodbeck/machineid v1.0.1
github.com/foxboron/go-uefi v0.0.0-20240128152106-48be911532c2
github.com/google/go-containerregistry v0.19.1
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/hashicorp/go-multierror v1.1.1
Expand Down Expand Up @@ -36,7 +43,7 @@ require (
atomicgo.dev/schedule v0.0.2 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Microsoft/hcsshim v0.11.4 // indirect
github.com/Microsoft/hcsshim v0.11.0 // indirect
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 // indirect
github.com/chuckpreslar/emission v0.0.0-20170206194824-a7ddd980baf9 // indirect
Expand Down Expand Up @@ -65,7 +72,7 @@ require (
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/itchyny/timefmt-go v0.1.5 // indirect
github.com/jaypipes/pcidb v1.0.0 // indirect
github.com/klauspost/compress v1.16.5 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lithammer/fuzzysearch v1.1.8 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
Expand All @@ -80,22 +87,23 @@ require (
github.com/rivo/uniseg v0.4.7 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/swaggest/refl v1.3.0 // indirect
github.com/twpayne/go-vfs v1.7.2 // indirect
github.com/vbatts/tar-split v0.11.3 // indirect
github.com/wayneashleyberry/terminal-dimensions v1.1.0 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/exp v0.0.0-20220916125017-b168a2c6b86b // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/net v0.22.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/term v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.17.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/grpc v1.58.3 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gotest.tools/v3 v3.4.0 // indirect
howett.net/plist v1.0.0 // indirect
)
Loading

0 comments on commit d729cc7

Please sign in to comment.