Add cache step to test workflow

This commit is contained in:
infogulch
2023-04-01 18:11:35 -05:00
parent 7279062d3c
commit 8792ee438c
4 changed files with 67 additions and 68 deletions

View File

@@ -6,66 +6,68 @@ jobs:
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
uses: baptiste0928/cargo-install@v1.1.0
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 }}

View File

@@ -10,7 +10,7 @@ license = "BSD-3-Clause"
keywords = ["prolog", "prolog-interpreter", "prolog-system"]
categories = ["command-line-utilities"]
build = "build/main.rs"
rust-version = "1.61"
rust-version = "1.63"
[features]
default = ["rug"]
@@ -41,7 +41,7 @@ libc = "0.2.62"
modular-bitfield = "0.11.2"
ctrlc = "3.2.2"
ordered-float = "2.6.0"
phf = { version = "0.9", features = ["macros"] }
phf = { version = "0.9", features = ["macros"] }
ref_thread_local = "0.0.0"
rug = { version = "1.15.0", optional = true }
rustyline = "9.0.0"
@@ -49,7 +49,7 @@ ring = "0.16.13"
ripemd160 = "0.8.0"
sha3 = "0.8.2"
blake2 = "0.8.1"
crrl ="0.2.0"
crrl = "0.2.0"
native-tls = "0.2.4"
chrono = "0.4.11"
select = "0.4.3"

View File

@@ -60,7 +60,7 @@ Extend Scryer Prolog to include the following, among other features:
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:
@@ -131,7 +131,7 @@ After compilation, the executable `scryer-prolog` is available in the
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:
@@ -141,7 +141,7 @@ light.exe scryer-prolog.wixobj
```
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

View File

@@ -4,7 +4,6 @@
<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"/>
<Property Id="APPHELPLINK" Value="https://github.com/mthom/scryer-prolog"/>
<Media Id="1" Cabinet="scryer.cab" EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="PFiles">
<Directory Id="INSTALLDIR" Name="Scryer Prolog">
@@ -14,18 +13,16 @@
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Component Id="ApplicationShortcut" Guid="8c9b14a3-e7b1-4d30-a892-61d7371dcae2">
<Component Id="ApplicationShortcut" Guid="8c9b14a3-e7b1-4d30-a892-61d7371dcae2">
<Shortcut Id="ApplicationStarMenuShortcut" Name="Scryer Prolog" Description="Launch Scryer Prolog" Target="[#ScryerPrologEXE]" WorkingDirectory="INSTALLDIR"/>
<RemoveFolder Id="ApplicationShortcut" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\Microsoft\ScryerProlog" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
<RemoveFolder Id="ApplicationShortcut" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\Microsoft\ScryerProlog" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</Directory>
</Directory>
<Feature Id="Complete" Level="1" Display="expand" ConfigurableDirectory="INSTALLDIR">
<ComponentRef Id="MainExecutable"/>
<ComponentRef Id="ApplicationShortcut"/>
</Feature>
</Product>
</Wix>
</Wix>