From 6d36ebed69ed631149fb231dbe6c1760ecd88a7c Mon Sep 17 00:00:00 2001 From: "Reza (Shahin) Khanipour" Date: Mon, 22 Jul 2024 12:30:19 +0200 Subject: [PATCH] refactor(ci/cd): only run tests on pushes to main and PRs. --- .github/workflows/test.yml | 20 ++++++++++--------- .../.github/workflows/test.yml | 20 ++++++++++--------- .../.github/workflows/test.yml | 20 ++++++++++--------- .../.github/workflows/test.yml | 20 ++++++++++--------- .../.github/workflows/test.yml | 20 ++++++++++--------- 5 files changed, 55 insertions(+), 45 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 57dc12f..0bac655 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,6 +3,8 @@ name: "Test" on: pull_request: push: + branches: + - main jobs: tests: @@ -12,13 +14,13 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v26 - - uses: cachix/cachix-action@v14 - with: - name: devenv - - name: Install devenv.sh - run: nix profile install nixpkgs#devenv + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v26 + - uses: cachix/cachix-action@v14 + with: + name: devenv + - name: Install devenv.sh + run: nix profile install nixpkgs#devenv - - name: Build the devenv shell and run any pre-commit hooks - run: devenv test + - name: Build the devenv shell and run any pre-commit hooks + run: devenv test diff --git a/template/{% if language == 'Go' %}{{ project_name }}{% endif %}/.github/workflows/test.yml b/template/{% if language == 'Go' %}{{ project_name }}{% endif %}/.github/workflows/test.yml index 57dc12f..0bac655 100644 --- a/template/{% if language == 'Go' %}{{ project_name }}{% endif %}/.github/workflows/test.yml +++ b/template/{% if language == 'Go' %}{{ project_name }}{% endif %}/.github/workflows/test.yml @@ -3,6 +3,8 @@ name: "Test" on: pull_request: push: + branches: + - main jobs: tests: @@ -12,13 +14,13 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v26 - - uses: cachix/cachix-action@v14 - with: - name: devenv - - name: Install devenv.sh - run: nix profile install nixpkgs#devenv + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v26 + - uses: cachix/cachix-action@v14 + with: + name: devenv + - name: Install devenv.sh + run: nix profile install nixpkgs#devenv - - name: Build the devenv shell and run any pre-commit hooks - run: devenv test + - name: Build the devenv shell and run any pre-commit hooks + run: devenv test diff --git a/template/{% if language == 'Node.js' %}{{ project_name }}{% endif %}/.github/workflows/test.yml b/template/{% if language == 'Node.js' %}{{ project_name }}{% endif %}/.github/workflows/test.yml index 57dc12f..0bac655 100644 --- a/template/{% if language == 'Node.js' %}{{ project_name }}{% endif %}/.github/workflows/test.yml +++ b/template/{% if language == 'Node.js' %}{{ project_name }}{% endif %}/.github/workflows/test.yml @@ -3,6 +3,8 @@ name: "Test" on: pull_request: push: + branches: + - main jobs: tests: @@ -12,13 +14,13 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v26 - - uses: cachix/cachix-action@v14 - with: - name: devenv - - name: Install devenv.sh - run: nix profile install nixpkgs#devenv + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v26 + - uses: cachix/cachix-action@v14 + with: + name: devenv + - name: Install devenv.sh + run: nix profile install nixpkgs#devenv - - name: Build the devenv shell and run any pre-commit hooks - run: devenv test + - name: Build the devenv shell and run any pre-commit hooks + run: devenv test diff --git a/template/{% if language == 'Python' %}{{ project_name }}{% endif %}/.github/workflows/test.yml b/template/{% if language == 'Python' %}{{ project_name }}{% endif %}/.github/workflows/test.yml index 57dc12f..0bac655 100644 --- a/template/{% if language == 'Python' %}{{ project_name }}{% endif %}/.github/workflows/test.yml +++ b/template/{% if language == 'Python' %}{{ project_name }}{% endif %}/.github/workflows/test.yml @@ -3,6 +3,8 @@ name: "Test" on: pull_request: push: + branches: + - main jobs: tests: @@ -12,13 +14,13 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v26 - - uses: cachix/cachix-action@v14 - with: - name: devenv - - name: Install devenv.sh - run: nix profile install nixpkgs#devenv + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v26 + - uses: cachix/cachix-action@v14 + with: + name: devenv + - name: Install devenv.sh + run: nix profile install nixpkgs#devenv - - name: Build the devenv shell and run any pre-commit hooks - run: devenv test + - name: Build the devenv shell and run any pre-commit hooks + run: devenv test diff --git a/template/{% if language == 'Rust' %}{{ project_name }}{% endif %}/.github/workflows/test.yml b/template/{% if language == 'Rust' %}{{ project_name }}{% endif %}/.github/workflows/test.yml index 57dc12f..0bac655 100644 --- a/template/{% if language == 'Rust' %}{{ project_name }}{% endif %}/.github/workflows/test.yml +++ b/template/{% if language == 'Rust' %}{{ project_name }}{% endif %}/.github/workflows/test.yml @@ -3,6 +3,8 @@ name: "Test" on: pull_request: push: + branches: + - main jobs: tests: @@ -12,13 +14,13 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v26 - - uses: cachix/cachix-action@v14 - with: - name: devenv - - name: Install devenv.sh - run: nix profile install nixpkgs#devenv + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v26 + - uses: cachix/cachix-action@v14 + with: + name: devenv + - name: Install devenv.sh + run: nix profile install nixpkgs#devenv - - name: Build the devenv shell and run any pre-commit hooks - run: devenv test + - name: Build the devenv shell and run any pre-commit hooks + run: devenv test