Build, Lint and Test #982
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build, Lint and Test | |
on: | |
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: | |
build: | |
name: Build, Lint and Test | |
runs-on: ${{ inputs.runner || 'ubuntu-22.04' }} | |
steps: | |
- name: Format branch name for cache key | |
run: | | |
BRANCH_NAME_FOR_CACHE="${GITHUB_REF_NAME//-/_}" | |
echo "branch_name_for_cache=${BRANCH_NAME_FOR_CACHE}" >> "$GITHUB_ENV" | |
- name: Setup cache | |
uses: actions/cache@v3 | |
with: | |
path: cache | |
key: compile-${{ env.branch_name_for_cache }}-${{ github.sha }} | |
restore-keys: | | |
compile-${{ env.branch_name_for_cache }}- | |
compile- | |
- name: Checkout everest-core | |
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 build-kit image | |
run: | | |
docker pull --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: Create integration-image | |
run: | | |
docker commit compile-container build-image | |
docker run \ | |
--volume "$(pwd):/ext" \ | |
--name test-container \ | |
build-image run-script test_and_install | |
docker commit test-container integration-image | |
- name: Run integration tests | |
run: | | |
pushd source/.ci/e2e | |
docker-compose run e2e-test-server run-script tests |