From b8702fbf307b2dea706a34629822b7ac545c1855 Mon Sep 17 00:00:00 2001 From: Filippo Costa Date: Sun, 2 Jun 2024 17:50:03 +0200 Subject: [PATCH] Update CI Signed-off-by: Filippo Costa --- .github/workflows/ci.yml | 95 ++++------------------------------------ rust-toolchain.toml | 2 +- 2 files changed, 9 insertions(+), 88 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e82fdca..cb5998f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,30 +12,20 @@ env: REGISTRY: ghcr.io jobs: - rustfmt: - name: rustfmt - strategy: - matrix: - rust: ["stable"] + lint: + name: Test runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - components: rustfmt - override: true - - name: Check formatting - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - uses: Swatinem/rust-cache@v2 + - run: cargo check --all-targets --all-features + - run: cargo test --verbose -- --nocapture docker-build-and-push: runs-on: ubuntu-latest + needs: lint permissions: contents: read packages: write @@ -58,72 +48,3 @@ jobs: with: push: true tags: ghcr.io/${{ github.repository_owner }}/graphix:latest - - build: - name: Build - strategy: - fail-fast: false - matrix: - rust: ["stable"] - runs-on: ubuntu-latest - - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - name: Cache cargo registry - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: test-cargo-${{ hashFiles('**/Cargo.toml') }} - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - override: true - - name: Build - uses: actions-rs/cargo@v1 - with: - command: build - - test: - name: Test - strategy: - fail-fast: false - matrix: - rust: ["stable"] - runs-on: ubuntu-latest - services: - postgres: - image: postgres - env: - POSTGRES_PASSWORD: postgres - POSTGRES_DB: graphix_test - ports: - - 5432:5432 - env: - GRAPHIX_TEST_DB_URL: "postgresql://postgres:postgres@localhost:5432/graphix_test" - - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - name: Cache cargo registry - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: test-cargo-${{ hashFiles('**/Cargo.toml') }} - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - override: true - - name: Test - uses: actions-rs/cargo@v1 - with: - command: test - args: --verbose -- --nocapture diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 1c8cfba..d2bc0cc 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.75.0" +channel = "1.78.0" profile = "default"