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 }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
os: [ubuntu-20.04, macos-10.15] include:
rust-version: [stable, beta] - { os: windows-latest, rust-version: stable, shell: 'msys2 {0}' }
steps: - { os: macos-10.15, rust-version: stable, shell: bash }
- name: Checkout sources - { os: ubuntu-20.04, rust-version: stable, shell: bash }
uses: actions/checkout@v2 - { os: ubuntu-20.04, rust-version: 1.63, shell: bash }
- name: Install Rust - { os: ubuntu-20.04, rust-version: beta, shell: bash }
uses: actions-rs/toolchain@v1 - { os: ubuntu-20.04, rust-version: nightly, shell: bash }
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
defaults: defaults:
run: run:
shell: msys2 {0} shell: ${{ matrix.shell }}
outputs:
os: ${{ matrix.os }}
rust-version: ${{ matrix.rust-version }}
steps: steps:
- name: Setup MSYS2 - uses: actions/checkout@v3
uses: msys2/setup-msys2@v2 - 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: with:
update: true update: true
install: >- install: >-
base-devel base-devel
mingw-w64-x86_64-rust mingw-w64-x86_64-rust
- name: Checkout sources - uses: actions/cache@v3
uses: actions/checkout@v3 with:
- name: Test on Windows 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 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"] keywords = ["prolog", "prolog-interpreter", "prolog-system"]
categories = ["command-line-utilities"] categories = ["command-line-utilities"]
build = "build/main.rs" build = "build/main.rs"
rust-version = "1.61" rust-version = "1.63"
[features] [features]
default = ["rug"] default = ["rug"]
@@ -49,7 +49,7 @@ ring = "0.16.13"
ripemd160 = "0.8.0" ripemd160 = "0.8.0"
sha3 = "0.8.2" sha3 = "0.8.2"
blake2 = "0.8.1" blake2 = "0.8.1"
crrl ="0.2.0" crrl = "0.2.0"
native-tls = "0.2.4" native-tls = "0.2.4"
chrono = "0.4.11" chrono = "0.4.11"
select = "0.4.3" select = "0.4.3"

View File

@@ -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. 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 ### 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"/> <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"/> <Property Id="APPHELPLINK" Value="https://github.com/mthom/scryer-prolog"/>
<Media Id="1" Cabinet="scryer.cab" EmbedCab="yes" /> <Media Id="1" Cabinet="scryer.cab" EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="PFiles"> <Directory Id="ProgramFilesFolder" Name="PFiles">
<Directory Id="INSTALLDIR" Name="Scryer Prolog"> <Directory Id="INSTALLDIR" Name="Scryer Prolog">
@@ -21,11 +20,9 @@
</Component> </Component>
</Directory> </Directory>
</Directory> </Directory>
<Feature Id="Complete" Level="1" Display="expand" ConfigurableDirectory="INSTALLDIR"> <Feature Id="Complete" Level="1" Display="expand" ConfigurableDirectory="INSTALLDIR">
<ComponentRef Id="MainExecutable"/> <ComponentRef Id="MainExecutable"/>
<ComponentRef Id="ApplicationShortcut"/> <ComponentRef Id="ApplicationShortcut"/>
</Feature> </Feature>
</Product> </Product>
</Wix> </Wix>