Skip to content

Commit

Permalink
feat: migrate to Github Actions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
walterchris committed Feb 15, 2024
1 parent 7efd5f3 commit d351175
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 209 deletions.
206 changes: 0 additions & 206 deletions .circleci/config.yml

This file was deleted.

82 changes: 82 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Build and Test
on:
push:
tags:
- v*
branches:
- main
pull_request:
jobs:
build:
strategy:
matrix:
go-arch: [amd64, arm64]
runs-on: ubuntu-latest
env:
CGO_ENABLED: 0
GOARCH: ${{ matrix.go-arch }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build txt-suite
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
- name: Build txt-prov
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
- name: Build bg-suite
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
- name: Build bg-prov
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
- name: Build pcr0tool
run: go build -ldflags '-X main.gitcommit=${GITHUB_SHA} -X main.gittag=${github.ref_name} -w -extldflags "-static"' -o pcr0tool cmd/pcr0tool/*.go
- name: Build amd-suite
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
- name: Save artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts-${{ matrix.go-arch }}
path: |
./txt-suite
./txt-prov
./bg-suite
./bg-prov
./pcr0tool
./amd-suite

test:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: go test
run: go test -v ./pkg/...

generateTemplates:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get install jq
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: artifacts-amd64
path: ./artifacts
- name: Make artifacts executable
run: chmod +x ./artifacts/*
- name: Generate Template-v-1 (bg-prov)
run: |
./artifacts/bg-prov template-v-1 --svn=1 --acmsvn=1 --nems=2 \
--pbet=12 --ibbflags=1 --mchbar=123456 --vdtbar=120000 --dmabase0=130000 \
--dmasize0=2048 --entrypoint=140000 --ibbhash=SHA256 config.json
cat ./config.json | jq
- name: Generate Template-v-2 (bg-prov)
run: |
./artifacts/bg-prov template-v-1 --svn=1 --acmsvn=1 --nems=2 \
--pbet=12 --ibbflags=1 --mchbar=123456 --vdtbar=120000 --dmabase0=130000 \
--dmasize0=2048 --entrypoint=140000 --ibbhash=SHA256 config.json
cat ./config.json | jq
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
version: latest
working-directory: pkg
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Documentation

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

Tooling & API
-------------
Expand Down

0 comments on commit d351175

Please sign in to comment.