Skip to content

Commit 7eb08e9

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

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: Setup SoftHSM
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get -y install libsofthsm2
25+
26+
- name: Build
27+
run: make
28+
29+
- name: Generate Keys And Certs
30+
run: |
31+
mkdir keys-and-certs && cd keys-and-certs
32+
mkdir certs private && echo 01 > serial
33+
touch index.txt
34+
cp /etc/ssl/openssl.cnf .
35+
36+
- name: Generate Private Key
37+
working-directory: keys-and-certs
38+
run: |
39+
openssl genpkey -algorithm RSA -out private/key.pem
40+
41+
- name: Generate Server Certificate and Sign with Private Key
42+
working-directory: keys-and-certs
43+
run: |
44+
openssl req -batch -new -x509 -days 365 -config openssl.cnf -key private/key.pem -out certs/cert.pem -extensions v3_ca -addext "subjectAltName = DNS:localhost"
45+
46+
- name: Client Certificate Generation
47+
working-directory: keys-and-certs
48+
run: |
49+
mkdir client
50+
mkdir client/private
51+
mkdir client/certs
52+
mkdir client/csr
53+
openssl genpkey -algorithm RSA -out client/private/key.pem
54+
openssl req -new -sha256 -config openssl.cnf -key client/private/key.pem -out client/csr/csr.pem
55+
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

0 commit comments

Comments
 (0)