From 991175f2aa36fb6a7f99d029cde6b1cf039cab36 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Sun, 30 Jan 2022 09:49:15 +0000 Subject: [PATCH] Add depth and avoidance for build --- .github/workflows/build.yml | 15 +++++++++++++++ .github/workflows/lint.yml | 3 +++ .github/workflows/test-integration.yml | 1 + .github/workflows/test.yml | 1 + 4 files changed, 20 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 589d8c58..b8ea7d6c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,21 +15,36 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v14.1 + with: + fetch-depth: 2 + files: | + go.* + **/*.go + integration_test/ + config-example.yaml + - name: Setup Go + if: steps.changed-files.outputs.any_changed == 'true' uses: actions/setup-go@v2 with: go-version: "1.17" - name: Install dependencies + if: steps.changed-files.outputs.any_changed == 'true' run: | go version sudo apt update sudo apt install -y make - name: Run build + if: steps.changed-files.outputs.any_changed == 'true' run: make build - uses: actions/upload-artifact@v2 + if: steps.changed-files.outputs.any_changed == 'true' with: name: headscale-linux path: headscale diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 65b37f5f..1c0e86d4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,6 +13,7 @@ jobs: id: changed-files uses: tj-actions/changed-files@v14.1 with: + fetch-depth: 2 files: | go.* **/*.go @@ -40,6 +41,7 @@ jobs: id: changed-files uses: tj-actions/changed-files@v14.1 with: + fetch-depth: 2 files: | **/*.md **/*.yml @@ -52,6 +54,7 @@ jobs: **/*.html - name: Prettify code + if: steps.changed-files.outputs.any_changed == 'true' uses: creyD/prettier_action@v4.0 with: prettier_options: >- diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index c0613705..f6eb7b48 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -13,6 +13,7 @@ jobs: id: changed-files uses: tj-actions/changed-files@v14.1 with: + fetch-depth: 2 files: | go.* **/*.go diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6f8ac08e..c2859467 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,6 +13,7 @@ jobs: id: changed-files uses: tj-actions/changed-files@v14.1 with: + fetch-depth: 2 files: | go.* **/*.go