do ci different #659
Workflow file for this run
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: CI | |
on: | |
schedule: | |
- cron: '30 5 * * *' | |
push: | |
paths: | |
- '**.cfg' | |
- '**.nims' | |
- '**.nim' | |
- '**.nimble' | |
- 'tests/**' | |
- '.github/workflows/ci.yml' | |
pull_request: | |
paths: | |
- '**.cfg' | |
- '**.nims' | |
- '**.nim' | |
- '**.nimble' | |
- 'tests/**' | |
- '.github/workflows/ci.yml' | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
#os: ['macos-latest', 'ubuntu-latest'] | |
os: ['ubuntu-latest'] | |
nim: ['devel', 'version-1-6', 'version-1-4', 'version-1-2'] | |
name: '${{ matrix.os }} (${{ matrix.nim }})' | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
path: ci | |
- name: Setup Nim | |
uses: alaviss/setup-nim@0.1.1 | |
with: | |
path: nim | |
version: ${{ matrix.nim }} | |
- name: Run tests | |
shell: bash | |
run: | | |
cd ci | |
git fetch --unshallow | |
nimble --accept develop | |
nimble --accept install "https://github.com/disruptek/balls" | |
git clone --depth 1 --branch v1.3.0 https://github.com/libgit2/libgit2.git | |
cd libgit2 | |
mkdir build | |
cd build | |
cmake .. | |
cmake --build . -- --quiet | |
cd ../.. | |
nimble -y develop | |
if [ "${{ matrix.os }}" == "macos-latest" ]; then | |
balls --backend:c --backend:cpp --mm:arc --mm:orc -d:libgit2Lib="$(pwd)/libgit2/build/libgit2.dylib" --passc:"-I$(pwd)/libgit2/include" | |
else | |
balls --backend:c --backend:cpp --mm:arc --mm:orc -d:libgit2Lib="$(pwd)/libgit2/build/libgit2.so" --passc:"-I$(pwd)/libgit2/include" | |
fi | |
- name: Build docs | |
if: ${{ matrix.docs }} == 'true' | |
shell: bash | |
run: | | |
cd ci | |
branch=${{ github.ref }} | |
branch=${branch##*/} | |
nimble doc --project --outdir:docs \ | |
'--git.url:https://github.com/${{ github.repository }}' \ | |
'--git.commit:${{ github.sha }}' \ | |
"--git.devel:$branch" \ | |
gittyup.nim | |
# Ignore failures for older Nim | |
cp docs/{the,}index.html || true | |
- name: Publish docs | |
if: > | |
github.event_name == 'push' && github.ref == 'refs/heads/master' && | |
matrix.os == 'ubuntu-latest' && matrix.nim == 'devel' | |
uses: crazy-max/ghaction-github-pages@v1 | |
with: | |
build_dir: ci/docs | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |