-
Notifications
You must be signed in to change notification settings - Fork 6
57 lines (54 loc) · 1.37 KB
/
ci.yml
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
name: ci
on:
pull_request:
branches:
- "main"
push:
branches:
- "main"
jobs:
commitlint:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: commitlint
uses: wagoid/commitlint-github-action@v5
test:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Docker
uses: docker/setup-buildx-action@v3
- name: Build
id: build
uses: docker/build-push-action@v5
with:
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
load: true
target: test
- name: Test
run: docker run --rm -t ${{ steps.build.outputs.imageid }} pytest
release:
runs-on: ubuntu-22.04
needs: [commitlint, test]
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install semantic-release
run: npm i semantic-release@v23.0.0 conventional-changelog-conventionalcommits@7.0.2
- name: Release
env:
GITHUB_USERNAME: ${{ secrets.GH_USERNAME }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: npx semantic-release