Skip to content

Commit bb4130e

Browse files
chore(ci): add ci
1 parent 5135601 commit bb4130e

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CI
2+
on: [push, pull_request]
3+
jobs:
4+
5+
build:
6+
name: Build and Test
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
go: [ 1.24.x ]
11+
steps:
12+
13+
- name: Set up Go
14+
uses: actions/setup-go@v2
15+
with:
16+
go-version: ${{ matrix.go }}
17+
18+
- name: Check out code
19+
uses: actions/checkout@v2
20+
21+
- name: Generate Keys And Certs
22+
run: |
23+
mkdir keys-and-certs && cd keys-and-certs
24+
mkdir certs private && echo 01 > serial
25+
touch index.txt
26+
cp /etc/ssl/openssl.cnf .
27+
28+
- name: Generate Private Key
29+
working-directory: keys-and-certs
30+
run: |
31+
openssl genpkey -algorithm RSA -out private/key.pem
32+
33+
- name: Generate Server Certificate and Sign with Private Key
34+
working-directory: keys-and-certs
35+
run: |
36+
openssl req -new -x509 -days 365 -config openssl.cnf -key private/key.pem -out certs/cert.pem -extensions v3_ca -addext "subjectAltName = DNS:localhost" -subj "/C=DE/ST=BW/L=Walldorf/O=OCM/CN=localhost"
37+
38+
- name: Client Certificate Generation
39+
working-directory: keys-and-certs
40+
run: |
41+
mkdir client
42+
mkdir client/private
43+
mkdir client/certs
44+
mkdir client/csr
45+
openssl genpkey -algorithm RSA -out client/private/key.pem
46+
openssl req -new -sha256 -config openssl.cnf -key client/private/key.pem -out client/csr/csr.pem
47+
openssl x509 -req -in client/csr/csr.pem -CA certs/cert.pem -CAkey private/key.pem -out client/certs/cert.pem -CAcreateserial -days 365 -sha256
48+
49+
- name: Setup SoftHSM
50+
run: |
51+
sudo apt-get update
52+
sudo apt-get -y install libsofthsm2
53+
54+
- name: Build
55+
run: make

0 commit comments

Comments
 (0)