Skip to content

On Windows, test 64-bit GNU and 32-bit MSVC as well #81

On Windows, test 64-bit GNU and 32-bit MSVC as well

On Windows, test 64-bit GNU and 32-bit MSVC as well #81

Workflow file for this run

on:

Check failure on line 1 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/main.yml

Invalid workflow file

Invalid type for `job.strategy`
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main
- "[0-9].x"
- windows-support
name: Continuous integration
jobs:
ci:
env:
RUSTFLAGS: ${{ matrix.rust == 'nightly' && matrix.os == 'ubuntu-latest' && '-Z sanitizer=leak' || '' }}
strategy:
fail-fast: false
matrix:
rust:
- stable
- nightly
os:
- ubuntu-latest
- windows-latest
include:
os: windows-latest
rust: stable-x86_64-pc-windows-gnu
include:
os: windows-latest
rust: stable-i686-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache cargo registry
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Install rustup if needed
- run: |
if ! command -v rustup &>/dev/null; then
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
fi
if: runner.os != 'Windows'
shell: bash
- name: Install toolchain
run: rustup toolchain install ${{ matrix.rust }} --profile minimal --no-self-update
shell: bash
- name: Build pg_query
uses: actions-rs/cargo@v1
with:
command: build
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
check_style:
name: Check file formatting and style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install rustup if needed
- run: |
if ! command -v rustup &>/dev/null; then
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
fi
if: runner.os != 'Windows'
shell: bash
- name: Install toolchain
run: rustup toolchain install stable --component clippy --component rustfmt --profile minimal --no-self-update
shell: bash
- name: Cache cargo registry
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: clippy-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Check file formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Run clippy
uses: actions-rs/cargo@v1
with:
command: clippy