Skip to content

Commit

Permalink
Migrate from docker to composite run actions
Browse files Browse the repository at this point in the history
https://docs.github.com/en/actions/creating-actions/creating-a-composite-run-steps-action

It should be able to reuse the go build cache and share the same build
context/environment by using the same default workspace instead of using Docker.

It should resolve an issue such as #21 as well.
  • Loading branch information
haya14busa committed Aug 15, 2020
1 parent 82a29cf commit 87b1920
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/dockerimage.yml

This file was deleted.

11 changes: 0 additions & 11 deletions Dockerfile

This file was deleted.

18 changes: 16 additions & 2 deletions action.yml
Expand Up @@ -35,8 +35,22 @@ inputs:
description: 'Working directory relative to the root directory.'
default: '.'
runs:
using: 'docker'
image: 'Dockerfile'
using: 'composite'
steps:
- run: $GITHUB_ACTION_PATH/entrypoint.sh
shell: bash
env:
REVIEWDOG_VERSION: v0.10.2
GOLANGCI_LINT_VERSION: v1.30.0
INPUT_GITHUB_TOKEN: ${{ inputs.github_token }}
INPUT_GOLANGCI_LINT_FLAGS: ${{ inputs.golangci_lint_flags }}
INPUT_TOOL_NAME: ${{ inputs.tool_name }}
INPUT_LEVEL: ${{ inputs.level }}
INPUT_REPORTER: ${{ inputs.reporter }}
INPUT_FILTER_MODE: ${{ inputs.filter_mode }}
INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }}
INPUT_REVIEWDOG_FLAGS: ${{ inputs.reviewdog_flags }}
INPUT_WORKDIR: ${{ inputs.workdir }}
branding:
icon: 'check-circle'
color: 'blue'
11 changes: 11 additions & 0 deletions entrypoint.sh
Expand Up @@ -2,6 +2,17 @@

cd "${GITHUB_WORKSPACE}/${INPUT_WORKDIR}" || exit 1

TEMP_PATH="$(mktemp -d)"
PATH="${TEMP_PATH}:$PATH"

echo '::group::🐶 Installing reviewdog ... https://github.com/reviewdog/reviewdog'
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b "${TEMP_PATH}" "${REVIEWDOG_VERSION}" 2>&1
echo '::endgroup::'

echo '::group::🐶 Installing golangci-lint ... https://github.com/golangci/golangci-lint'
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "${TEMP_PATH}" "${GOLANGCI_LINT_VERSION}" 2>&1
echo '::endgroup::'

export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"

# shellcheck disable=SC2086
Expand Down

0 comments on commit 87b1920

Please sign in to comment.