Procházet zdrojové kódy

ci: simplify

Signed-off-by: Christina Sørensen <ces@fem.gg>
Christina Sørensen před 1 rokem
rodič
revize
3c07044aed

+ 0 - 21
.github/workflows/conventional-commits.yml

@@ -1,21 +0,0 @@
-# SPDX-FileCopyrightText: 2024 Christina Sørensen
-# SPDX-License-Identifier: EUPL-1.2
-#
-# SPDX-FileCopyrightText: 2023-2024 Christina Sørensen, eza contributors
-# SPDX-FileCopyrightText: 2014 Benjamin Sago
-# SPDX-License-Identifier: MIT
-name: Conventional Commits
-on:
-  push:
-    branches: [main]
-  pull_request:
-    branches: [main]
-concurrency:
-  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
-  cancel-in-progress: true
-jobs:
-  conventional-commits:
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v4
-      - uses: webiny/action-conventional-commits@v1.3.0

+ 0 - 61
.github/workflows/flake.yml

@@ -1,61 +0,0 @@
-# SPDX-FileCopyrightText: 2024 Christina Sørensen
-# SPDX-License-Identifier: EUPL-1.2
-on:
-  workflow_dispatch:
-  pull_request:
-    branches: [main]
-    paths:
-      - '.github/workflows/flake.yml'
-      - 'src/**'
-      - 'Cargo.*'
-      - "*.toml"
-      - "flake.*"
-      - "*.nix"
-      - "*.rs"
-  push:
-    branches: [main]
-    paths:
-      - '.github/workflows/flake.yml'
-      - 'src/**'
-      - 'Cargo.*'
-      - "*.toml"
-      - "flake.*"
-      - "*.nix"
-      - "*.rs"
-concurrency:
-  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
-  cancel-in-progress: true
-jobs:
-  flake-checker:
-    name: Flake Checker
-    runs-on: ubuntu-22.04
-    steps:
-      - uses: actions/checkout@v4
-      - name: Check Nix flake inputs
-        uses: DeterminateSystems/flake-checker-action@v9
-  check:
-    name: Check Nix Flake
-    runs-on: ubuntu-22.04
-    steps:
-      - uses: actions/checkout@v4
-      - name: Install Nix
-        uses: DeterminateSystems/nix-installer-action@v16
-      - name: Setup Nix cache
-        uses: DeterminateSystems/magic-nix-cache-action@main
-      - name: Nix Flake Check
-        run: nix flake check --all-systems -L
-  build:
-    name: Build Nix package
-    # if cross compilation is desired add 'aarch64-linux', 'x86_64-darwin' and 'aarch64-darwin' and fix the flake to support cross compilation.
-    strategy:
-      matrix:
-        target: [x86_64-linux]
-    runs-on: ubuntu-22.04
-    steps:
-      - uses: actions/checkout@v4
-      - name: Install Nix
-        uses: DeterminateSystems/nix-installer-action@v16
-      - name: Setup Nix cache
-        uses: DeterminateSystems/magic-nix-cache-action@main
-      - name: Nix Build
-        run: nix build .#packages.${{ matrix.target }}.default -L

+ 0 - 23
.github/workflows/no-merge-commits.yml

@@ -1,23 +0,0 @@
-# SPDX-FileCopyrightText: 2024 Christina Sørensen
-# SPDX-License-Identifier: EUPL-1.2
-#
-# SPDX-FileCopyrightText: 2023-2024 Christina Sørensen, eza contributors
-# SPDX-FileCopyrightText: 2014 Benjamin Sago
-# SPDX-License-Identifier: MIT
-name: No Merge Commits
-on:
-  pull_request:
-    branches: [main]
-concurrency:
-  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
-  cancel-in-progress: true
-jobs:
-  no-merge-commits:
-    runs-on: ubuntu-latest
-    steps:
-      - name: Checkout
-        uses: actions/checkout@v4
-      - name: Run test
-        uses: NexusPHP/no-merge-commits@v2.1.0
-        with:
-          token: ${{ secrets.GITHUB_TOKEN }}

+ 49 - 0
.github/workflows/unit-tests.yml

@@ -27,7 +27,26 @@ env:
   CARGO_TERM_COLOR: always
   CARGO_TERM_COLOR: always
   RUSTFLAGS: --deny warnings
   RUSTFLAGS: --deny warnings
 jobs:
 jobs:
+  no-merge-commits:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v4
+      - name: Run test
+        uses: NexusPHP/no-merge-commits@v2.1.0
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+
+  conventional:
+    needs: no-merge-commits
+    name: Conventional Commits
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - uses: webiny/action-conventional-commits@v1.3.0
+
   unit-tests:
   unit-tests:
+    needs: conventional
     runs-on: ${{ matrix.os }}
     runs-on: ${{ matrix.os }}
     continue-on-error: ${{ matrix.rust == 'nightly' }}
     continue-on-error: ${{ matrix.rust == 'nightly' }}
     strategy:
     strategy:
@@ -52,3 +71,33 @@ jobs:
         run: cargo clippy -- -D warnings
         run: cargo clippy -- -D warnings
       - name: Run unit tests
       - name: Run unit tests
         run: cargo hack test
         run: cargo hack test
+
+  flake-check:
+    needs: conventional
+    name: Check Nix Flake
+    runs-on: ubuntu-22.04
+    steps:
+      - uses: actions/checkout@v4
+      - name: Install Nix
+        uses: DeterminateSystems/nix-installer-action@v16
+      - name: Setup Nix cache
+        uses: DeterminateSystems/magic-nix-cache-action@main
+      - name: Nix Flake Check
+        run: nix flake check --all-systems -L
+
+  flake-build:
+    needs: conventional
+    name: Build Nix package
+    # if cross compilation is desired add 'aarch64-linux', 'x86_64-darwin' and 'aarch64-darwin' and fix the flake to support cross compilation.
+    strategy:
+      matrix:
+        target: [x86_64-linux]
+    runs-on: ubuntu-22.04
+    steps:
+      - uses: actions/checkout@v4
+      - name: Install Nix
+        uses: DeterminateSystems/nix-installer-action@v16
+      - name: Setup Nix cache
+        uses: DeterminateSystems/magic-nix-cache-action@main
+      - name: Nix Build
+        run: nix build .#packages.${{ matrix.target }}.default -L