2024-08-06 14:24:13 +00:00
|
|
|
name: Daily Common
|
|
|
|
# Serves as base workflow for daily tasks, it's not run by itself.
|
2023-12-01 09:47:47 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
2024-08-06 14:24:13 +00:00
|
|
|
nim:
|
|
|
|
description: 'Nim Configuration'
|
2023-12-01 09:47:47 +00:00
|
|
|
required: true
|
2024-08-06 14:24:13 +00:00
|
|
|
type: string # Following this format: [{"branch": ..., "memory_management": ...}, ...]
|
2023-12-18 19:14:33 +00:00
|
|
|
cpu:
|
|
|
|
description: 'CPU'
|
2023-12-01 09:47:47 +00:00
|
|
|
required: true
|
|
|
|
type: string
|
2023-12-18 19:14:33 +00:00
|
|
|
exclude:
|
|
|
|
description: 'Exclude matrix configurations'
|
|
|
|
required: false
|
|
|
|
type: string
|
|
|
|
default: "[]"
|
2023-12-01 09:47:47 +00:00
|
|
|
|
2024-08-06 14:24:13 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2023-12-01 09:47:47 +00:00
|
|
|
jobs:
|
2024-08-06 14:24:13 +00:00
|
|
|
delete_cache:
|
|
|
|
name: Delete github action's branch cache
|
2023-12-01 09:47:47 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: snnaplab/delete-branch-cache-action@v1
|
|
|
|
|
2024-08-06 14:24:13 +00:00
|
|
|
test:
|
|
|
|
needs: delete_cache
|
|
|
|
timeout-minutes: 90
|
2023-12-01 09:47:47 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-12-18 19:14:33 +00:00
|
|
|
platform:
|
|
|
|
- os: linux
|
2024-07-11 08:22:16 +00:00
|
|
|
builder: ubuntu-22.04
|
2023-12-01 09:47:47 +00:00
|
|
|
shell: bash
|
2023-12-18 19:14:33 +00:00
|
|
|
- os: macos
|
2024-07-11 08:22:16 +00:00
|
|
|
builder: macos-13
|
2023-12-01 09:47:47 +00:00
|
|
|
shell: bash
|
2023-12-18 19:14:33 +00:00
|
|
|
- os: windows
|
2024-07-11 08:22:16 +00:00
|
|
|
builder: windows-2022
|
2023-12-01 09:47:47 +00:00
|
|
|
shell: msys2 {0}
|
2024-08-06 14:24:13 +00:00
|
|
|
nim: ${{ fromJSON(inputs.nim) }}
|
2023-12-18 19:14:33 +00:00
|
|
|
cpu: ${{ fromJSON(inputs.cpu) }}
|
|
|
|
exclude: ${{ fromJSON(inputs.exclude) }}
|
2023-12-01 09:47:47 +00:00
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
2023-12-18 19:14:33 +00:00
|
|
|
shell: ${{ matrix.platform.shell }}
|
2023-12-01 09:47:47 +00:00
|
|
|
|
2024-08-06 14:24:13 +00:00
|
|
|
name: '${{ matrix.platform.os }}-${{ matrix.cpu }} (Nim ${{ matrix.nim.branch }})'
|
2023-12-18 19:14:33 +00:00
|
|
|
runs-on: ${{ matrix.platform.builder }}
|
2024-08-06 14:24:13 +00:00
|
|
|
continue-on-error: ${{ matrix.nim.branch == 'devel' || matrix.nim.branch == 'version-2-0' }}
|
2023-12-01 09:47:47 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Setup Nim
|
|
|
|
uses: "./.github/actions/install_nim"
|
|
|
|
with:
|
2023-12-18 19:14:33 +00:00
|
|
|
os: ${{ matrix.platform.os }}
|
|
|
|
shell: ${{ matrix.platform.shell }}
|
2024-08-06 14:24:13 +00:00
|
|
|
nim_branch: ${{ matrix.nim.branch }}
|
2023-12-18 19:14:33 +00:00
|
|
|
cpu: ${{ matrix.cpu }}
|
2023-12-01 09:47:47 +00:00
|
|
|
|
|
|
|
- name: Setup Go
|
2024-08-06 14:24:13 +00:00
|
|
|
uses: actions/setup-go@v5
|
2023-12-01 09:47:47 +00:00
|
|
|
with:
|
|
|
|
go-version: '~1.15.5'
|
|
|
|
cache: false
|
|
|
|
|
|
|
|
- name: Install p2pd
|
|
|
|
run: |
|
|
|
|
V=1 bash scripts/build_p2pd.sh p2pdCache 124530a3
|
2024-08-06 14:24:13 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
nimble install -y --depsOnly
|
2023-12-01 09:47:47 +00:00
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: |
|
|
|
|
nim --version
|
|
|
|
nimble --version
|
2024-08-06 14:24:13 +00:00
|
|
|
NIMFLAGS="${NIMFLAGS} --mm:${{ matrix.nim.memory_management }}" nimble test
|