CI #1153
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: | |
branches: | |
- master | |
paths: | |
- '**.cfg' | |
- '**.nims' | |
- '**.nim' | |
- '**.nimble' | |
- '**.sh' | |
- 'tests/**' | |
- '.github/workflows/ci.yml' | |
pull_request: | |
branches: | |
- '*' | |
paths: | |
- '**.cfg' | |
- '**.nims' | |
- '**.nim' | |
- '**.nimble' | |
- '**.sh' | |
- 'tests/**' | |
- '.github/workflows/ci.yml' | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
#os: ['windows-latest', 'macos-latest', 'ubuntu-latest'] | |
#os: ['macos-latest', 'ubuntu-latest'] | |
os: ['ubuntu-latest'] | |
nim: ['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/[email protected] | |
with: | |
path: nim | |
version: ${{ matrix.nim }} | |
- name: Setup libgit2 | |
shell: bash | |
run: | | |
cd ci | |
git clone --depth=1 --branch=v1.5.0 --quiet https://github.com/libgit2/libgit2.git | |
cd libgit2 | |
mkdir build | |
cd build | |
cmake .. | |
cmake --build . -- --quiet | |
- name: Run tests | |
shell: bash | |
run: | | |
mkdir $HOME/.nimble | |
cd ci | |
git fetch --unshallow | |
cp ci-bootstrap.cfg nim.cfg | |
./bootstrap-nonimble.sh | |
./nimph refresh | |
./nimph | |
./nimph doctor || true | |
cat nim.cfg | |
./nimph | |
./nimph doctor || true | |
cat nim.cfg | |
cd `./nimph path balls` | |
nim c --out:$HOME/balls --define:release balls.nim | |
cd - | |
echo "remove nim's config.nims...?" | |
ls -l `dirname \`which nim\``/../config/ | |
rm `dirname \`which nim\``/../config/config.nims || true | |
if [ "${{ matrix.os }}" == "macos-latest" ]; then | |
nim c --define:libgit2Lib="$(pwd)/libgit2/build/libgit2.dylib" --passC:"-I$(pwd)/libgit2/include" --define:ssl --define:release --run tests/test.nim | |
else | |
nim c --define:libgit2Lib="$(pwd)/libgit2/build/libgit2.so" --passC:"-I$(pwd)/libgit2/include" --define:ssl --define:release --run tests/test.nim | |
fi | |
- name: Build docs | |
if: ${{ matrix.docs }} == 'true' | |
shell: bash | |
run: | | |
cd ci | |
branch=${{ github.ref }} | |
branch=${branch##*/} | |
mv ci-docs.cfg nim.cfg | |
rm -rf deps | |
mkdir deps | |
./nimph doctor || true | |
cat nim.cfg | |
nim doc --project --outdir:docs \ | |
'--git.url:https://github.com/${{ github.repository }}' \ | |
'--git.commit:${{ github.sha }}' \ | |
"--git.devel:$branch" \ | |
src/nimph.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 == 'version-1-6' | |
uses: crazy-max/ghaction-github-pages@v1 | |
with: | |
build_dir: ci/docs | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |