8000 GitHub - cedrickring/golang-action at v2.0.0-beta.2
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Nov 2, 2021. It is now read-only.

cedrickring/golang-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Actions Status

Golang Action

This Action allows you to run Go commands with your code. It will automatically setup your workspace (~/go/src/github.com/<your-name>/<repo>) before the command is run.

NOTE: As of v2.0.0 the dep support will be dropped for go versions greater than 1.14.x.

How to use

Create a workflow.yaml file in .github/workflows with the following contents:

on: push
name: My cool Action
jobs:
  checks:
    name: run
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master

    - name: run
      uses: cedrickring/golang-action@v2.0.0

If no args are specified and a Makefile is detected, this action will run make. Otherwise go test and go build will be run. To run a custom command, use:

steps:
- name: Run custom command
  uses: cedrickring/golang-action@v2.0.0
  with:
    customCommand: make my-target

If your go project is not located at the root of the repo you can also specify environment variable PROJECT_PATH:

steps:
- name: Custom project path
  uses: cedrickring/golang-action@v2.0.0
  with:
    projectPath: "path/in/my/project"

To use a specific golang version (1.14, 1.15), defaults to the latest version:

steps:
- name: Use Go 1.14
  uses: cedrickring/golang-action/go1.14@v2.0.0

About

A GitHub Action to run Go commands

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 10

0