mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-02 21:43:11 +00:00
107 lines
4.7 KiB
YAML
107 lines
4.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
cache_nonce: 0 # Allows for easily busting actions/cache caches
|
|
nim_version: v2.2.4
|
|
builder_integration_from_vars: true
|
|
builder_integration_linux: runner-node-01-linux-03-eu-hel1
|
|
builder_integration_macos: macos-14-xlarge
|
|
builder_integration_windows: windows-latest-amd64-32vcpu
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
matrix:
|
|
name: Compute matrix
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
matrix: ${{ steps.matrix.outputs.matrix }}
|
|
cache_nonce: ${{ env.cache_nonce }}
|
|
steps:
|
|
- name: Compute builders
|
|
if: ${{ env.builder_integration_from_vars == 'true' }}
|
|
run: |
|
|
if [[ -n "${{ vars.builder_integration_linux }}" ]]; then echo "builder_integration_linux=${{ vars.builder_integration_linux }}"; fi >> $GITHUB_ENV
|
|
if [[ -n "${{ vars.builder_integration_macos }}" ]]; then echo "builder_integration_macos=${{ vars.builder_integration_macos }}"; fi >> $GITHUB_ENV
|
|
if [[ -n "${{ vars.builder_integration_windows }}" ]]; then echo "builder_integration_windows=${{ vars.builder_integration_windows }}"; fi >> $GITHUB_ENV
|
|
|
|
- name: Compute matrix
|
|
id: matrix
|
|
uses: fabiocaccamo/create-matrix-action@v5
|
|
with:
|
|
matrix: |
|
|
os {linux}, cpu {amd64}, builder {ubuntu-latest}, tests {unittest}, nim_version {${{ env.nim_version }}}, shell {bash --noprofile --norc -e -o pipefail}
|
|
os {linux}, cpu {amd64}, builder {ubuntu-latest}, tests {contract}, nim_version {${{ env.nim_version }}}, shell {bash --noprofile --norc -e -o pipefail}
|
|
os {linux}, cpu {amd64}, builder {${{ env.builder_integration_linux }}}, tests {integration}, nim_version {${{ env.nim_version }}}, shell {bash --noprofile --norc -e -o pipefail}
|
|
os {linux}, cpu {amd64}, builder {ubuntu-latest}, tests {tools}, nim_version {${{ env.nim_version }}}, shell {bash --noprofile --norc -e -o pipefail}
|
|
os {macos}, cpu {arm64}, builder {macos-14}, tests {unittest}, nim_version {${{ env.nim_version }}}, shell {bash --noprofile --norc -e -o pipefail}
|
|
os {macos}, cpu {arm64}, builder {macos-14}, tests {contract}, nim_version {${{ env.nim_version }}}, shell {bash --noprofile --norc -e -o pipefail}
|
|
os {macos}, cpu {arm64}, builder {${{ env.builder_integration_macos }}}, tests {integration}, nim_version {${{ env.nim_version }}}, shell {bash --noprofile --norc -e -o pipefail}
|
|
os {macos}, cpu {arm64}, builder {macos-14}, tests {tools}, nim_version {${{ env.nim_version }}}, shell {bash --noprofile --norc -e -o pipefail}
|
|
os {windows}, cpu {amd64}, builder {windows-latest}, tests {unittest}, nim_version {${{ env.nim_version }}}, shell {msys2}
|
|
os {windows}, cpu {amd64}, builder {windows-latest}, tests {contract}, nim_version {${{ env.nim_version }}}, shell {msys2}
|
|
os {windows}, cpu {amd64}, builder {${{ env.builder_integration_windows }}}, tests {integration}, nim_version {${{ env.nim_version }}}, shell {msys2}
|
|
os {windows}, cpu {amd64}, builder {windows-latest}, tests {tools}, nim_version {${{ env.nim_version }}}, shell {msys2}
|
|
|
|
build:
|
|
needs: matrix
|
|
uses: ./.github/workflows/ci-reusable.yml
|
|
with:
|
|
matrix: ${{ needs.matrix.outputs.matrix }}
|
|
cache_nonce: ${{ needs.matrix.outputs.cache_nonce }}
|
|
|
|
linting:
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'pull_request'
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Check `nph` formatting
|
|
uses: arnetheduck/nph-action@v1
|
|
with:
|
|
version: 0.6.1
|
|
options: "codex/ tests/"
|
|
fail: true
|
|
suggest: true
|
|
|
|
coverage:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
- name: Setup Nimbus Build System
|
|
uses: ./.github/actions/nimbus-build-system
|
|
with:
|
|
os: linux
|
|
nim_version: ${{ env.nim_version }}
|
|
coverage: true
|
|
|
|
- name: Generate coverage data
|
|
run: |
|
|
# make -j${ncpu} coverage
|
|
make -j${ncpu} coverage-script
|
|
shell: bash
|
|
|
|
- name: Upload coverage data to Codecov
|
|
uses: codecov/codecov-action@v4
|
|
with:
|
|
directory: ./coverage/
|
|
fail_ci_if_error: true
|
|
files: ./coverage/coverage.f.info
|
|
flags: unittests
|
|
name: codecov-umbrella
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
verbose: true
|