First cut at CI workflows (#6)
Co-authored-by: Shrukan <shrukan@shrukanslab.xyz> Reviewed-on: sl-devs/CppTemplate#6
This commit is contained in:
55
.gitea/workflows/build_and_test.yml
Normal file
55
.gitea/workflows/build_and_test.yml
Normal file
@ -0,0 +1,55 @@
|
||||
name: Build and Test Code
|
||||
run-name: ${{ gitea.ref }} Build
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
container: gitea.shrukanslab.xyz/CppTemplate/dev-environment:latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Unit test
|
||||
run: just test
|
||||
|
||||
coverage:
|
||||
runs-on: ubuntu-latest
|
||||
container: gitea.shrukanslab.xyz/CppTemplate/dev-environment:latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Coverage
|
||||
run: just coverage
|
||||
|
||||
- name: Compress coverage report
|
||||
run: tar -czf build/coverage.tar.gz build/meson-logs/coveragereport
|
||||
|
||||
- name: Archive coverage report
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: docs
|
||||
path: build/coverage.tar.gz
|
||||
retention-days: 5
|
||||
|
||||
static_analysis:
|
||||
runs-on: ubuntu-latest
|
||||
container: gitea.shrukanslab.xyz/CppTemplate/dev-environment:latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Static analysis
|
||||
run: just check
|
||||
|
||||
sanitize:
|
||||
runs-on: ubuntu-latest
|
||||
container: gitea.shrukanslab.xyz/CppTemplate/dev-environment:latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Sanitize
|
||||
run: just sanitize
|
||||
25
.gitea/workflows/build_docs.yml
Normal file
25
.gitea/workflows/build_docs.yml
Normal file
@ -0,0 +1,25 @@
|
||||
name: Build Docs
|
||||
run-name: ${{ gitea.ref }} Build
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
build-docs:
|
||||
runs-on: ubuntu-latest
|
||||
container: gitea.shrukanslab.xyz/CppTemplate/dev-environment:latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build docs
|
||||
run: just docs
|
||||
|
||||
- name: Compress docs
|
||||
run: tar -czf build/docs.tar.gz build/docs
|
||||
|
||||
- name: Archive docs
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: docs
|
||||
path: build/docs.tar.gz
|
||||
retention-days: 5
|
||||
36
.gitea/workflows/build_image.yml
Normal file
36
.gitea/workflows/build_image.yml
Normal file
@ -0,0 +1,36 @@
|
||||
name: Build Image
|
||||
run-name: ${{ gitea.ref }} Build
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
build-dev-image:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Docker
|
||||
run: curl -fsSL https://get.docker.com | sh
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Log into Gitea
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: gitea.shrukanslab.xyz
|
||||
username: ${{ secrets.ROBOT_USERNAME }}
|
||||
password: ${{ secrets.ROBOT_PASSWORD }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: |
|
||||
gitea.shrukanslab.xyz/CppTemplate/dev-environment:latest
|
||||
|
||||
- name: Logout from Docker Registry
|
||||
run: docker logout gitea.shrukanslab.xyz
|
||||
Reference in New Issue
Block a user