Skip to content

Commit d351175

Browse files
committed
feat: migrate to Github Actions
Migrate our current CI to github actions. Additionally remove the .rpm and .deb builds on version tags. Add template generation for bg-prov. Signed-off-by: Christian Walter <christian.walter@9elements.com>
1 parent 7efd5f3 commit d351175

4 files changed

Lines changed: 85 additions & 209 deletions

File tree

.circleci/config.yml

Lines changed: 0 additions & 206 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Build and Test
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
branches:
7+
- main
8+
pull_request:
9+
jobs:
10+
build:
11+
strategy:
12+
matrix:
13+
go-arch: [amd64, arm64]
14+
runs-on: ubuntu-latest
15+
env:
16+
CGO_ENABLED: 0
17+
GOARCH: ${{ matrix.go-arch }}
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
- name: Build txt-suite
22+
run: go build -ldflags '-X main.gitcommit=${GITHUB_SHA} -X main.gittag=${github.ref_name} -w -extldflags "-static"' -o txt-suite cmd/txt-suite/*.go
23+
- name: Build txt-prov
24+
run: go build -ldflags '-X main.gitcommit=${GITHUB_SHA} -X main.gittag=${github.ref_name} -w -extldflags "-static"' -o txt-prov cmd/txt-prov/*.go
25+
- name: Build bg-suite
26+
run: go build -ldflags '-X main.gitcommit=${GITHUB_SHA} -X main.gittag=${github.ref_name} -w -extldflags "-static"' -o bg-suite cmd/bg-suite/*.go
27+
- name: Build bg-prov
28+
run: go build -ldflags '-X main.gitcommit=${GITHUB_SHA} -X main.gittag=${github.ref_name} -w -extldflags "-static"' -o bg-prov cmd/bg-prov/*.go
29+
- name: Build pcr0tool
30+
run: go build -ldflags '-X main.gitcommit=${GITHUB_SHA} -X main.gittag=${github.ref_name} -w -extldflags "-static"' -o pcr0tool cmd/pcr0tool/*.go
31+
- name: Build amd-suite
32+
run: go build -ldflags '-X main.gitcommit=${GITHUB_SHA} -X main.gittag=${github.ref_name} -w -extldflags "-static"' -o amd-suite cmd/amd-suite/*.go
33+
- name: Save artifacts
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: artifacts-${{ matrix.go-arch }}
37+
path: |
38+
./txt-suite
39+
./txt-prov
40+
./bg-suite
41+
./bg-prov
42+
./pcr0tool
43+
./amd-suite
44+
45+
46+
test:
47+
needs: build
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v4
52+
- name: go test
53+
run: go test -v ./pkg/...
54+
55+
generateTemplates:
56+
needs: build
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@v4
61+
- name: Install dependencies
62+
run: sudo apt-get install jq
63+
- name: Download Artifacts
64+
uses: actions/download-artifact@v4
65+
with:
66+
name: artifacts-amd64
67+
path: ./artifacts
68+
- name: Make artifacts executable
69+
run: chmod +x ./artifacts/*
70+
- name: Generate Template-v-1 (bg-prov)
71+
run: |
72+
./artifacts/bg-prov template-v-1 --svn=1 --acmsvn=1 --nems=2 \
73+
--pbet=12 --ibbflags=1 --mchbar=123456 --vdtbar=120000 --dmabase0=130000 \
74+
--dmasize0=2048 --entrypoint=140000 --ibbhash=SHA256 config.json
75+
cat ./config.json | jq
76+
77+
- name: Generate Template-v-2 (bg-prov)
78+
run: |
79+
./artifacts/bg-prov template-v-1 --svn=1 --acmsvn=1 --nems=2 \
80+
--pbet=12 --ibbflags=1 --mchbar=123456 --vdtbar=120000 --dmabase0=130000 \
81+
--dmasize0=2048 --entrypoint=140000 --ibbhash=SHA256 config.json
82+
cat ./config.json | jq

.github/workflows/golangci-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
name: lint
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
- name: golangci-lint
17-
uses: golangci/golangci-lint-action@v3
17+
uses: golangci/golangci-lint-action@v4
1818
with:
1919
version: latest
2020
working-directory: pkg

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Documentation
1717

1818
Build Status
1919
------------
20-
[![CircleCI](https://circleci.com/gh/9elements/converged-security-suite.svg?style=svg)](https://circleci.com/gh/9elements/converged-security-suite)
20+
![Build and Test](https://github.com/9elements/converged-security-suite/actions/workflows/build.yml/badge.svg)
2121

2222
Tooling & API
2323
-------------

0 commit comments

Comments
 (0)