Skip to content

Commit

Permalink
Fixing linux binaries (#99)
Browse files Browse the repository at this point in the history
This also adds docs as a verifying step to the CI process (to make sure
there are no warnings or errors).

Fixes #98
Fixes #97
  • Loading branch information
elliotchance authored Jun 20, 2022
1 parent 9f82626 commit 5cf7ac8
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 22 deletions.
85 changes: 70 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
- '**.rst'

jobs:
run:
name: Run
tests:
name: Tests
runs-on: macos-latest
steps:
- name: Checkout
Expand All @@ -23,31 +23,87 @@ jobs:
- name: Verify fmt
run: make fmt-verify

- name: Verify docs
run: |
pip install sphinx sphinx_rtd_theme
cd docs && python3 -m pip install -r requirements.txt && cd -
make clean-docs docs
- name: Run SQL tests
run: make test

- name: Run examples
run: make examples

- name: Set version
if: startsWith(github.ref, 'refs/tags/')
run: sed -i -e "s/MISSING_VERSION/${GITHUB_REF##*/} `date +'%F'`/g" cmd/vsql.v
macos-binary:
name: Build for macOS
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up V version latest
uses: nocturlab/setup-vlang-action@v1
with:
v-version: master
id: v

- name: Build macOS binaries
run: |
sed -i -e "s/MISSING_VERSION/${GITHUB_REF##*/} `date +'%F'`/g" cmd/vsql.v
make vsql
zip -j vsql-macos.zip cmd/vsql
# See https://github.com/vlang/v/issues/10992
#- name: Build linux binaries
# run: |
# v -os linux -prod cmd/vsql.v
# zip -j vsql-linux.zip cmd/vsql
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
vsql-macos.zip
linux-binary:
name: Build for Linux
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up V version latest
uses: nocturlab/setup-vlang-action@v1
with:
v-version: master
id: v

- name: Build linux binaries
run: |
sed -i -e "s/MISSING_VERSION/${GITHUB_REF##*/} `date +'%F'`/g" cmd/vsql.v
make vsql
zip -j vsql-linux.zip cmd/vsql
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
vsql-linux.zip
# Cross compiling for windows takes a long time because mingw-w64 has to be
# installed. It would be nice to skip this, but until we have code that
# specific to each OS we need to keep this in place.
- name: Build windows binaries
# I know it seems pretty silly that we're using macOS and cross compling for
# Windows. But I couldn't get window-latest to work. If you use windows please
# put in a PR to fix this.
windows-binary:
name: Build for Windows
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up V version latest
uses: nocturlab/setup-vlang-action@v1
with:
v-version: master
id: v

- name: Build Windows binaries
run: |
brew install mingw-w64
v -os windows -prod cmd/vsql.v
Expand All @@ -58,5 +114,4 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
vsql-macos.zip
vsql-windows.zip
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
# `-gc` values.
BUILD_OPTIONS =

# Ideally we compile with "-prod" because it should make the resulting binaries
# faster. However, this has to be disabled for now.
# See https://github.com/elliotchance/vsql/issues/97
PROD = # -prod
PROD = -prod

# Binaries

Expand All @@ -17,7 +14,8 @@ vsql:
# Documentation

docs:
cd docs && make html
mkdir -p docs/_static
cd docs && make html SPHINXOPTS="-W --keep-going -n"

clean-docs:
cd docs && make clean
Expand Down
3 changes: 1 addition & 2 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ If you receive an error, you might be missing some dependencies:

.. code-block:: sh
pip3 install sphinx
pip3 install sphinx sphinx_rtd_theme
cd docs && python3 -m pip install -r requirements.txt
pip3 install sphinx_rtd_theme
``make docs`` will only regenerate the parts that it thinks have changed. To
rebuild the entire docs you can use:
Expand Down

0 comments on commit 5cf7ac8

Please sign in to comment.