File: ci.yaml

package info (click to toggle)
spike 0.8.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,252 kB
  • sloc: xml: 2,730; sh: 429; makefile: 23
file content (116 lines) | stat: -rw-r--r-- 3,390 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: CI

#    \\ SPIKE: Secure your secrets with SPIFFE. — https://spike.ist/
#  \\\\\ Copyright 2024-present SPIKE contributors.
# \\\\\\\ SPDX-License-Identifier: Apache-2.0

on:
  pull_request: {}
  push:
    branches:
      - main

jobs:
  go-build:
    # This job effectively exists to ensure that the code can still be built
    # with the proposed changes.
    name: Go - Build
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: read
      checks: write
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Set up Go
        uses: actions/setup-go@v5
        with:
          go-version-file: 'go.mod'
      - run: make build
  go-unit-test:
    name: Go - Unit Tests
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: read
      checks: write
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Set up Go
        uses: actions/setup-go@v5
        with:
          go-version-file: 'go.mod'
      - name: Unit Tests
        # run: go test -race -shuffle=on -coverprofile=coverage.txt ./...
        run: make test
  go-lint:
    name: Go - Lint
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: read
      checks: write
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Set up Go
        uses: actions/setup-go@v5
        with:
          go-version-file: 'go.mod'
      - name: Lint Code
        run: make audit
  integration:
    name: Integration Test
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4.1.1
        with:
          fetch-depth: 0

      - name: Set up Helm
        uses: azure/setup-helm@v3.5
        with:
          version: v3.16.2

      - name: Create kind v1.33.1 cluster
        uses: helm/kind-action@v1.9.0
        with:
          version: v0.29.0
          node_image: kindest/node:v1.33.1
          config: .github/kind/conf/kind-config.yaml
          verbosity: 1

      - name: Create kind ${{ matrix.k8s }} cluster
        run: |
          set -xe
          teardown() {
            if [ $1 -ne 0 ]; then
              kubectl get pods -A
              kubectl describe pods -A
            fi
          }
          trap 'EC=$? && trap - SIGTERM && teardown $EC' SIGINT SIGTERM EXIT
          make docker-build
          docker images
          docker tag spike-pilot:dev ghcr.io/spiffe/spike-pilot:dev
          docker tag spike-nexus:dev ghcr.io/spiffe/spike-nexus:dev
          docker tag spike-keeper:dev ghcr.io/spiffe/spike-keeper:dev
          docker tag spike-demo:dev ghcr.io/spiffe/spike-demo:dev
          docker tag spike-bootstrap:dev ghcr.io/spiffe/spike-bootstrap:dev
          kind load docker-image --name chart-testing ghcr.io/spiffe/spike-pilot:dev
          kind load docker-image --name chart-testing ghcr.io/spiffe/spike-nexus:dev
          kind load docker-image --name chart-testing ghcr.io/spiffe/spike-keeper:dev
          kind load docker-image --name chart-testing ghcr.io/spiffe/spike-demo:dev
          kind load docker-image --name chart-testing ghcr.io/spiffe/spike-bootstrap:dev
          cd ci/integration/minio-rolearn
          ./setup.sh
          ./test.sh