Skip to content

Commit

Permalink
Don't use actions-rs/toolchain@v1, it's unmaintained
Browse files Browse the repository at this point in the history
  • Loading branch information
lfittl committed Jan 9, 2024
1 parent 0a2995a commit f4ea6d1
Showing 1 changed file with 34 additions and 27 deletions.
61 changes: 34 additions & 27 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -34,39 +34,51 @@ jobs:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-${{ matrix.backend }}-cargo-${{ hashFiles('**/Cargo.toml') }}
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
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
run: rustup toolchain install ${{ matrix.rust }} --profile minimal --no-self-update
shell: bash

- name: Default to nightly if requested
run: rustup default nightly
if: matrix.rust == 'nightly'

- name: Build pg_query
uses: actions-rs/cargo@v1
with:
command: build
run: cargo build

- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
run: cargo test

check_style:
name: Check file formatting and style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: clippy, rustfmt
override: true
- 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
Expand All @@ -77,12 +89,7 @@ jobs:
key: clippy-cargo-${{ hashFiles('**/Cargo.toml') }}

- name: Check file formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
run: cargo fmt --all -- --check

- name: Run clippy
uses: actions-rs/cargo@v1
with:
command: clippy
run: cargo clippy

0 comments on commit f4ea6d1

Please sign in to comment.