From e6eb6e320f42fe16ec2081479fad8e425f987678 Mon Sep 17 00:00:00 2001 From: Richard Pringle Date: Mon, 29 Apr 2024 11:29:07 -0400 Subject: [PATCH] Abstract install-go action --- .github/actions/install-go/action.yml | 18 ++++++++++++++++++ .github/workflows/rust-ci.yml | 24 ++++++------------------ 2 files changed, 24 insertions(+), 18 deletions(-) create mode 100644 .github/actions/install-go/action.yml diff --git a/.github/actions/install-go/action.yml b/.github/actions/install-go/action.yml new file mode 100644 index 0000000000..e2d4b9be8c --- /dev/null +++ b/.github/actions/install-go/action.yml @@ -0,0 +1,18 @@ +name: 'Install Go toolchain with defaults' +description: 'Install a go toolchain with defaults' + +inputs: + cache: + description: "to cache or not to cache, that is the question" + required: false + default: "true" + +runs: + using: composite + steps: + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.21' + check-latest: true + cache: ${{ inputs.cache }} diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 99b1049a26..caca66a2cd 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -31,12 +31,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.21' - check-latest: true - cache: true + - name: Install Go + uses: ./.github/actions/install-go - name: Install Rust uses: ./.github/actions/install-rust with: @@ -50,12 +46,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.21' - check-latest: true - cache: true + - name: Install Go + uses: ./.github/actions/install-go - name: Install Rust uses: ./.github/actions/install-rust with: @@ -69,12 +61,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.21' - check-latest: true - cache: true + - name: Install Go + uses: ./.github/actions/install-go - name: Install Rust uses: ./.github/actions/install-rust with: