strings: perform allocate-then-copy for filter #359
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: [push, pull_request] | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
branch: [devel] | |
compiler: | |
- name: nim | |
version: devel | |
- name: nim | |
version: version-2-0 | |
- name: nim | |
version: version-1-6 | |
- name: nimskull | |
version: "*" | |
target: [linux, macos, windows] | |
arch: [i386, amd64] | |
include: | |
- target: linux | |
builder: ubuntu-20.04 | |
- target: macos | |
builder: macos-11 | |
- target: windows | |
builder: windows-2019 | |
- target: windows | |
arch: i386 | |
winlib_arch: i686 | |
- target: windows | |
arch: amd64 | |
winlib_arch: x86_64 | |
- target: linux | |
arch: amd64 | |
branch: devel | |
builddocs: true | |
exclude: | |
- target: macos | |
arch: i386 | |
name: | |
${{ matrix.target }} on ${{ matrix.arch }} (${{ matrix.compiler.name }} | |
${{ matrix.compiler.version }}) | |
runs-on: ${{ matrix.builder }} | |
defaults: | |
run: | |
shell: bash | |
working-directory: nim-sys | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
path: nim-sys | |
submodules: "recursive" | |
- name: Configure Nim for 32 bit GCC (Linux-only) | |
if: matrix.arch == 'i386' && runner.os == 'Linux' | |
run: | | |
sudo apt-fast update -qq | |
sudo DEBIAN_FRONTEND='noninteractive' apt-fast install \ | |
--no-install-recommends -yq \ | |
gcc-10-i686-linux-gnu \ | |
g++-10-i686-linux-gnu \ | |
libc6-dev-i386-cross \ | |
libstdc++-10-dev-i386-cross | |
mkdir -p ~/.config/nim | |
cat << EOF > ~/.config/nim/nim.cfg | |
cpu = "i386" | |
gcc.exe = "i686-linux-gnu-gcc-10" | |
gcc.cpp.exe = "i686-linux-gnu-g++-10" | |
gcc.linkerexe = "i686-linux-gnu-gcc-10" | |
gcc.cpp.linkerexe = "i686-linux-gnu-g++-10" | |
EOF | |
- name: Configure target architecture for Windows (i386) | |
if: matrix.arch == 'i386' && runner.os == 'Windows' | |
run: | | |
mkdir -p "$APPDATA/nim" | |
echo 'cpu = "i386"' >> "$APPDATA/nim/nim.cfg" | |
- name: Setup GCC (Windows-only) | |
if: runner.os == 'Windows' | |
uses: bwoodsend/[email protected] | |
with: | |
architecture: ${{ matrix.winlib_arch }} | |
- name: Setup Nim | |
if: matrix.compiler.name == 'nim' | |
uses: alaviss/[email protected] | |
with: | |
path: nim | |
version: ${{ matrix.compiler.version }} | |
architecture: ${{ matrix.arch }} | |
- name: Setup nimskull | |
id: nimskull | |
if: matrix.compiler.name == 'nimskull' | |
uses: nim-works/[email protected] | |
with: | |
nimskull-version: ${{ matrix.compiler.version }} | |
- name: Fetch nimble source for nimskull | |
if: matrix.compiler.name == 'nimskull' | |
uses: actions/[email protected] | |
with: | |
path: nimble | |
repository: alaviss/nimble | |
ref: nimskull | |
- name: Install nimble for nimskull | |
if: matrix.compiler.name == 'nimskull' | |
run: | | |
nim c -d:release -o:"$NIMSKULL_BIN/nimble" src/nimble.nim | |
# Add nimble binary folder to PATH | |
echo "$HOME/.nimble/bin" >> "$GITHUB_PATH" | |
working-directory: nimble | |
env: | |
NIMSKULL_BIN: ${{ steps.nimskull.outputs.bin-path }} | |
- name: Install dependencies | |
run: | | |
nimble install -y --depsOnly | |
nimble install -y "https://github.com/disruptek/balls@>= 3.9.11 & < 4.0.0" | |
- name: Run tests | |
run: balls | |
- name: Build docs | |
shell: bash | |
run: | | |
branch=${{ github.ref }} | |
branch=${branch##*/} | |
for i in src/sys/*.nim src/sys/ioqueue/*.nim; do | |
nimble doc --project --outdir:htmldocs \ | |
'--git.url:https://github.com/${{ github.repository }}' \ | |
'--git.commit:${{ github.sha }}' \ | |
"--git.devel:$branch" \ | |
"$i" | |
done | |
# Ignore failures for older Nim | |
cp htmldocs/{the,}index.html || true | |
- name: Upload GitHub Pages artifact | |
if: matrix.builddocs | |
uses: actions/[email protected] | |
with: | |
path: nim-sys/htmldocs | |
deploy: | |
needs: build | |
if: github.ref == 'refs/heads/master' | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
name: Deploy docs to GitHub Pages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy page | |
id: deployment | |
uses: actions/[email protected] |