Skip to content

Commit

Permalink
ci-pipline an action to setup environemtn
Browse files Browse the repository at this point in the history
  • Loading branch information
MKAbdElrahman committed Sep 4, 2024
1 parent 6804773 commit 13ca561
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 27 deletions.
16 changes: 16 additions & 0 deletions .github/actions/setup-environment/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "Setup Environment"
description: "Sets up the environment by checking out code, setting up Go, and installing Task CLI."
runs:
using: "composite"
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: stable
cache: false

- name: Install Task CLI
uses: arduino/setup-task@v2
with:
version: 3.x
33 changes: 6 additions & 27 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,8 @@ jobs:
name: Lint Application
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
cache: false
- name: Install Task CLI
uses: arduino/setup-task@v2
with:
version: 3.x
- name: Setup Environment
uses: ./.github/actions/setup-environment
- name: Install GolangCI-Lint
run: task instal-golangci-lint
- name: Run Lint
Expand All @@ -26,15 +19,8 @@ jobs:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
cache: false
- name: Install Task CLI
uses: arduino/setup-task@v2
with:
version: 3.x
- name: Setup Environment
uses: ./.github/actions/setup-environment
- name: Run Test
run: task test

Expand All @@ -43,15 +29,8 @@ jobs:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
cache: false
- name: Install Task CLI
uses: arduino/setup-task@v2
with:
version: 3.x
- name: Setup Environment
uses: ./.github/actions/setup-environment
- name: Build
run: task build
- name: Copy Files
Expand Down

0 comments on commit 13ca561

Please sign in to comment.