Skip to content

general: Add CI

general: Add CI #1

name: Build and test libfsm
on:
push: {}
pull_request: {}
workflow_dispatch:
inputs:
runner:
description: Which runner to use
type: choice
default: 'ubuntu-22.04'
required: true
options:
- 'ubuntu-22.04'
- 'large-ubuntu-22.04-xxl'
schedule:
- cron: '37 13,1 * * *'
jobs:
test:
name: Build and test libfsm
runs-on: ${{ inputs.runner || 'ubuntu-22.04' }}
steps:
- name: Checkout libfsm
uses: actions/checkout@v3
with:
path: source
- name: Run clang-format
uses: everest/everest-ci/github-actions/[email protected]
with:
source-dir: source
extensions: hpp,cpp
exclude: cache
- name: Setup run scripts
run: |
mkdir scripts
rsync -a source/.ci/build-kit/ scripts
- name: Pull docker container
run: |
docker pull --platform=linux/x86_64 --quiet ghcr.io/everest/build-kit-alpine:latest
docker image tag ghcr.io/everest/build-kit-alpine:latest build-kit
- name: Compile
run: |
docker run \
--volume "$(pwd):/ext" \
--name compile-container \
build-kit run-script compile
- name: Unit test and install
run: |
docker commit compile-container build-image
docker run \
--volume "$(pwd):/ext" \
--name test-container \
build-image run-script test_and_install