runs-on: ${{ matrix.os }}
strategy:
matrix:
- os: [ubuntu-20.04, macos-10.15]
- rust-version: [stable, beta]
- steps:
- - name: Checkout sources
- uses: actions/checkout@v2
- - name: Install Rust
- uses: actions-rs/toolchain@v1
- with:
- profile: minimal
- toolchain: ${{ matrix.rust-version }}
- override: true
- - name: Build lib
- uses: actions-rs/cargo@v1
- with:
- command: rustc
- args: --verbose --lib -- -D warnings
- - name: Build bin
- uses: actions-rs/cargo@v1
- with:
- command: rustc
- args: --verbose --bin scryer-prolog -- -D warnings
- - name: Test
- uses: actions-rs/cargo@v1
- with:
- command: test
- args: --verbose --all
- - name: Num tests
- uses: actions-rs/cargo@v1
- continue-on-error: true
- with:
- command: test
- args: --verbose --all --no-default-features --features num
- msrv:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: [ubuntu-20.04, macos-10.15]
- steps:
- - name: Checkout sources
- uses: actions/checkout@v2
- - name: Install cargo-msrv
- with:
- crate: cargo-msrv
- - name: Verify MSRV
- run: cargo msrv --verify
- windows:
- runs-on: windows-latest
+ include:
+ - { os: windows-latest, rust-version: stable, shell: 'msys2 {0}' }
+ - { os: macos-10.15, rust-version: stable, shell: bash }
+ - { os: ubuntu-20.04, rust-version: stable, shell: bash }
+ - { os: ubuntu-20.04, rust-version: 1.63, shell: bash }
+ - { os: ubuntu-20.04, rust-version: beta, shell: bash }
+ - { os: ubuntu-20.04, rust-version: nightly, shell: bash }
defaults:
run:
- shell: msys2 {0}
+ shell: ${{ matrix.shell }}
+ outputs:
+ os: ${{ matrix.os }}
+ rust-version: ${{ matrix.rust-version }}
steps:
- - name: Setup MSYS2
- uses: msys2/setup-msys2@v2
+ - uses: actions/checkout@v3
+ - uses: dtolnay/rust-toolchain@master
+ if: "!startsWith(matrix.os, 'windows')"
+ id: toolchain
+ with:
+ toolchain: ${{ matrix.rust-version }}
+ components: clippy, rustfmt
+ - uses: msys2/setup-msys2@v2
+ if: startsWith(matrix.os,'windows')
with:
update: true
install: >-
base-devel
mingw-w64-x86_64-rust
- - name: Checkout sources
- uses: actions/checkout@v3
- - name: Test on Windows
+ - uses: actions/cache@v3
+ with:
+ path: |
+ ~/.cargo/bin/
+ ~/.cargo/registry/index/
+ ~/.cargo/registry/cache/
+ ~/.cargo/git/db/
+ target/
+ key: ${{ matrix.os }}_rustc-${{ steps.toolchain.outputs.cachekey }}_cargo-${{ hashFiles('**/Cargo.lock') }}
+
+ # Build and test.
+ - name: Build library
+ run: cargo rustc --verbose --lib -- -D warnings
+ - name: Test
run: cargo test --verbose --all
+
+ # Only run formatting & style check on one job to not spam warnings.
+ - name: Check formatting
+ if: startsWith(matrix.os,'ubuntu') && matrix.rust-version == 'stable'
+ run: cargo fmt --check || echo "::warning ::cargo fmt found some formatting changes that may improve readability"
+ - name: Check clippy
+ if: startsWith(matrix.os,'ubuntu') && matrix.rust-version == 'stable'
+ run: cargo clippy || echo "::warning ::cargo clippy found some code style changes that may be more idiomatic"
+
+ # On stable rust builds, build a binary and publish as a github actions
+ # artifact. These binaries could be useful for testing the pipeline but
+ # are only retained by github for 90 days.
+ # TODO: Check that they actually work.
+ - name: Build release binary
+ if: matrix.rust-version == 'stable'
+ run: cargo rustc --verbose --bin scryer-prolog --release -- -D warnings
+ - name: Publish artifact
+ if: matrix.rust-version == 'stable'
+ uses: actions/upload-artifact@v3
+ with:
+ path: target/release/scryer-prolog*
+ name: scryer-prolog_${{ matrix.os }}
characters, using a packed internal representation.
- [x] clp(B) and clp(ℤ) as builtin libraries.
- [x] Streams and predicates for stream control.
- - [x] A simple sockets library representing TCP connections as streams.
+ - [x] A simple sockets library representing TCP connections as streams.
- [x] Incremental compilation and loading process, newly written,
primarily in Prolog.
- [ ] Improvements to the WAM compiler and heap representation:
directory `target/release` and can be invoked to run the system.
On Windows, Scryer Prolog is easier to build inside a [MSYS2](https://www.msys2.org/)
-environment as some crates may require native C compilation. However,
+environment as some crates may require native C compilation. However,
the resulting binary does not need MSYS2 to run. When executing Scryer in a shell, it is recommended to use a more advanced shell than mintty (the default MSYS2 shell). The [Windows Terminal](https://github.com/microsoft/terminal) works correctly.
To build a Windows Installer, you'll need first Scryer Prolog compiled in release mode, then, with WiX Toolset installed, execute:
```
It will generate a very basic MSI file which installs the main executable and a shortcut in the Start Menu. It can be installed with a double-click. To uninstall, go to the Control Panel and uninstall as usual.
-Scryer Prolog must be built with **Rust 1.61 and up**.
+Scryer Prolog must be built with **Rust 1.63 and up**.
### Docker Install
<Package Description="An open source industrial strength production environment for ISO Prolog that is also a testbed for bleeding edge research in logic and constraint programming, which is itself written in a high-level language." Platform="x64" Keywords="prolog" Id="*" Compressed="yes" InstallScope="perMachine" InstallerVersion="300" Languages="1033" SummaryCodepage="1252" Manufacturer="Scryer Prolog contributors"/>\r
<Property Id="APPHELPLINK" Value="https://github.com/mthom/scryer-prolog"/>\r
<Media Id="1" Cabinet="scryer.cab" EmbedCab="yes" />\r
- \r
<Directory Id="TARGETDIR" Name="SourceDir">\r
<Directory Id="ProgramFilesFolder" Name="PFiles">\r
<Directory Id="INSTALLDIR" Name="Scryer Prolog">\r
</Directory>\r
</Directory>\r
<Directory Id="ProgramMenuFolder">\r
- <Component Id="ApplicationShortcut" Guid="8c9b14a3-e7b1-4d30-a892-61d7371dcae2">\r
+ <Component Id="ApplicationShortcut" Guid="8c9b14a3-e7b1-4d30-a892-61d7371dcae2">\r
<Shortcut Id="ApplicationStarMenuShortcut" Name="Scryer Prolog" Description="Launch Scryer Prolog" Target="[#ScryerPrologEXE]" WorkingDirectory="INSTALLDIR"/>\r
- <RemoveFolder Id="ApplicationShortcut" On="uninstall"/>\r
- <RegistryValue Root="HKCU" Key="Software\Microsoft\ScryerProlog" Name="installed" Type="integer" Value="1" KeyPath="yes"/>\r
- </Component>\r
+ <RemoveFolder Id="ApplicationShortcut" On="uninstall"/>\r
+ <RegistryValue Root="HKCU" Key="Software\Microsoft\ScryerProlog" Name="installed" Type="integer" Value="1" KeyPath="yes"/>\r
+ </Component>\r
</Directory>\r
</Directory>\r
-\r
<Feature Id="Complete" Level="1" Display="expand" ConfigurableDirectory="INSTALLDIR">\r
<ComponentRef Id="MainExecutable"/>\r
<ComponentRef Id="ApplicationShortcut"/>\r
</Feature>\r
</Product>\r
-</Wix>\r
- \r
+</Wix>
\ No newline at end of file