mirror of
https://github.com/vacp2p/nim-libp2p.git
synced 2025-03-03 09:31:08 +00:00
155 lines
3.9 KiB
YAML
155 lines
3.9 KiB
YAML
name: CI
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- unstable
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
timeout-minutes: 90
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
target:
|
|
- os: linux
|
|
cpu: amd64
|
|
- os: linux
|
|
cpu: i386
|
|
- os: macos
|
|
cpu: amd64
|
|
- os: windows
|
|
cpu: amd64
|
|
branch: ['1.2.18', 'stable']
|
|
include:
|
|
- target:
|
|
os: linux
|
|
builder: ubuntu-20.04
|
|
- target:
|
|
os: macos
|
|
builder: macos-10.15
|
|
- target:
|
|
os: windows
|
|
builder: windows-2019
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
name: '${{ matrix.target.os }}-${{ matrix.target.cpu }} (Nim ${{ matrix.branch }})'
|
|
runs-on: ${{ matrix.builder }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: true
|
|
|
|
- uses: jiro4989/setup-nim-action@v1
|
|
with:
|
|
nim-version: '${{ matrix.branch }}'
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: '~1.15.5'
|
|
|
|
- name: Install p2pd
|
|
run: |
|
|
V=1 bash scripts/build_p2pd.sh p2pdCache 124530a3
|
|
|
|
- name: Run tests
|
|
run: |
|
|
if [[ "${{ matrix.target.os }}" == "windows" ]]; then
|
|
# https://github.com/status-im/nimbus-eth2/issues/3121
|
|
export NIMFLAGS="-d:nimRawSetjmp"
|
|
fi
|
|
nim --version
|
|
nimble --version
|
|
nimble install_pinned
|
|
nimble test
|
|
|
|
bumpNBC-stable:
|
|
if: github.ref == 'refs/heads/master'
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: status-im/github-app-token@v1
|
|
name: Generate token
|
|
id: generate-token
|
|
with:
|
|
app_id: ${{ secrets.BUMP_BOT_APP_ID }}
|
|
private_key: ${{ secrets.BUMP_BOT_APP_PRIVATE_KEY }}
|
|
|
|
- name: Clone NBC
|
|
uses: actions/checkout@v2
|
|
with:
|
|
repository: status-im/nimbus-eth2
|
|
ref: unstable
|
|
path: nbc
|
|
submodules: true
|
|
fetch-depth: 0
|
|
|
|
- name: Checkout this ref
|
|
run: |
|
|
cd nbc/vendor/nim-libp2p
|
|
git checkout $GITHUB_SHA
|
|
|
|
- name: Commit this bump
|
|
run: |
|
|
cd nbc
|
|
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
|
|
git config --global user.name = "${{ github.actor }}"
|
|
git commit -a -m "auto-bump nim-libp2p"
|
|
|
|
- name: Make PR
|
|
uses: peter-evans/create-pull-request@v3.5.0
|
|
with:
|
|
branch: nim-libp2p-auto-bump
|
|
path: nbc
|
|
token: ${{ steps.generate-token.outputs.token }}
|
|
title: nim-libp2p auto bump
|
|
|
|
bumpNBC-unstable:
|
|
if: github.ref == 'refs/heads/unstable'
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: status-im/github-app-token@v1
|
|
name: Generate token
|
|
id: generate-token
|
|
with:
|
|
app_id: ${{ secrets.BUMP_BOT_APP_ID }}
|
|
private_key: ${{ secrets.BUMP_BOT_APP_PRIVATE_KEY }}
|
|
|
|
- name: Clone NBC
|
|
uses: actions/checkout@v2
|
|
with:
|
|
repository: status-im/nimbus-eth2
|
|
ref: unstable
|
|
path: nbc
|
|
submodules: true
|
|
fetch-depth: 0
|
|
|
|
- name: Checkout this ref
|
|
run: |
|
|
cd nbc/vendor/nim-libp2p
|
|
git checkout $GITHUB_SHA
|
|
|
|
- name: Commit this bump
|
|
run: |
|
|
cd nbc
|
|
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
|
|
git config --global user.name = "${{ github.actor }}"
|
|
git commit -a -m "auto-bump nim-libp2p"
|
|
|
|
- name: Make PR
|
|
uses: peter-evans/create-pull-request@v3.5.0
|
|
with:
|
|
branch: nim-libp2p-auto-bump-unstable
|
|
path: nbc
|
|
token: ${{ steps.generate-token.outputs.token }}
|
|
title: nim-libp2p unstable auto bump
|
|
draft: true
|