Skip to content

update global nixpkgs archive #2798

update global nixpkgs archive

update global nixpkgs archive #2798

Workflow file for this run

on:
push:
branches:
- main
paths-ignore:
- "docs/**"
pull_request:
paths-ignore:
- "docs/**"
name: CI
jobs:
check:
name: Check
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '(cargo-release)')"
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v2
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
lints:
name: Lints
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '(cargo-release)')"
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
# Set linting rules for clippy
args: --all-targets --all-features -- -D warnings
test-plan:
name: Test Suite
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
outputs:
matrix: ${{ steps.docker-prep.outputs.matrix }}
if: "!contains(github.event.head_commit.message, '(cargo-release)')"
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v2
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --package nixpacks --lib --test generate_plan_tests
- name: List docker tests (prep test-docker)
id: docker-prep
if: matrix.os == 'ubuntu-latest'
# generate list of tests in json format for test-docker
run: |
echo "::set-output name=matrix::{\"tests\":[\"$(cargo test -q --package nixpacks --test docker_run_tests -- --list --format=terse | sed -z 's/: test\n/\", \"/g' | sed 's/...$//')]}"
test-docker:
needs: test-plan
name: Docker Tests
runs-on: ubuntu-latest
strategy:
matrix: ${{fromJson(needs.test-plan.outputs.matrix)}}
if: "!contains(github.event.head_commit.message, '(cargo-release)')"
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --package nixpacks --test docker_run_tests -- ${{ matrix.tests }} --exact
msrv:
name: Test Suite (MSRV)
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, '(cargo-release)')"
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout sources
uses: actions/checkout@v4
- name: Install 1.60 rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.60.0
override: true
- uses: Swatinem/rust-cache@v2
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --package nixpacks --lib --test generate_plan_tests
flake:
name: Nix Flake
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '(cargo-release)')"
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout sources
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Run nix flake check
run: nix flake check