GithubHelp home page GithubHelp logo

mbrukman / golang-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cedrickring/golang-action

0.0 1.0 0.0 1.12 MB

A GitHub Action to run Go commands

License: Apache License 2.0

Dockerfile 16.64% Shell 52.64% Makefile 11.53% Go 19.19%

golang-action's Introduction

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.

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/[email protected]

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, just use:

steps:
- name: Run custom command
  uses: cedrickring/[email protected]
  with:
    args: make my-target

If your repository's import name is different from the path on GitHub, provide the import name by adding an environment variable IMPORT=import/name. This may be useful if you have forked an open source Go project:

steps:
- name: Run with custom import path
  uses: cedrickring/[email protected]
  env:
    IMPORT: "root/repo"

To use Go Modules add GO111MODULE=on to the step:

steps:
- name: Go Modules
  uses: cedrickring/[email protected]
  env:
    GO111MODULE: "on"

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/[email protected]
  env:
    PROJECT_PATH: "./path/in/my/project"

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

steps:
- name: Use Go 1.11
  uses: cedrickring/golang-action/[email protected]

golang-action's People

Contributors

cedrickring avatar dougnukem avatar jdharms avatar nivl avatar wormi4ok avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.