From 9e89d3dff77fc1688381a70bc41bc9c05b9dca88 Mon Sep 17 00:00:00 2001 From: Jasper Ginn Date: Fri, 5 Jan 2024 20:23:39 +0100 Subject: [PATCH] build: move steps to template dir --- .github/workflows/pipeline.yaml | 27 +++---------------- .../workflows/templates/checks/action.yaml | 27 +++++++++++++++++++ 2 files changed, 30 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/templates/checks/action.yaml diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index 19640dd..cc64997 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -12,30 +12,9 @@ permissions: jobs: checks: - name: 'Checks' + name: 'checks' #if: ${{ github.event_name == 'pull_request'}} runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - uses: actions/setup-python@v5 - with: - python-version: '3.10' - cache: 'pip' - - uses: extractions/setup-just@v1 - name: Setup just - - name: Initialize Pants - uses: pantsbuild/actions/init-pants@main - with: - # cache0 makes it easy to bust the cache if needed - gha-cache-key: cache0-py310 - named-caches-hash: ${{ hashFiles('lockfiles/*.json', '**/something-else.lock') }} - - name: format - run: just fmt - - name: lint - run: just lint - - name: test - run: just test - - name: package - run: just package + - name: 'checks' + uses: ./.github/workflows/templates/checks diff --git a/.github/workflows/templates/checks/action.yaml b/.github/workflows/templates/checks/action.yaml new file mode 100644 index 0000000..7717a73 --- /dev/null +++ b/.github/workflows/templates/checks/action.yaml @@ -0,0 +1,27 @@ +name: checks + +runs: + using: "composite" + steps: + - name: Checkout + uses: actions/checkout@v3 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: 'pip' + - uses: extractions/setup-just@v1 + name: Setup just + - name: Initialize Pants + uses: pantsbuild/actions/init-pants@main + with: + # cache0 makes it easy to bust the cache if needed + gha-cache-key: cache0-py310 + named-caches-hash: ${{ hashFiles('lockfiles/*.json', '**/something-else.lock') }} + - name: format + run: just fmt + - name: lint + run: just lint + - name: test + run: just test + - name: package + run: just package