Skip to content

Latest commit

 

History

History
302 lines (199 loc) · 5.17 KB

README.md

File metadata and controls

302 lines (199 loc) · 5.17 KB

Composite Run Steps GitHub Actions

A collection of composite run steps GitHub Actions.

Creating a composite action - GitHub Docs

Setup Docker Project

This composite action includes the following actions:

  • Install docker compose v2
  • Install docker buildx

Definition: setup-docker/action.yml

Install the Latest Version

name: CI

on:
  push:
  pull_request:

jobs:
  test:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v3
      - uses: peaceiris/workflows/[email protected]
      - run: docker compose version
      - run: docker buildx version

Install a Specific Version

name: CI

on:
  push:
  pull_request:

jobs:
  test:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v3
      - uses: peaceiris/workflows/[email protected]
        with:
          compose-version: '2.4.1'
          buildx-version: '0.8.2'
      - run: docker compose version
      - run: docker buildx version

Setup Go Project

This composite action includes the following actions:

  • actions/setup-go
  • peaceiris/workflows/setup-mage
  • peaceiris/workflows/setup-goreleaser
  • actions/cache

Definition: setup-go/action.yml

name: CI

on:
  push:
  pull_request:

jobs:
  test:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v3

      - uses: peaceiris/workflows/[email protected]
        with:
          go-version: '1.18'

      - run: go version
      - run: mage -h
      - run: goreleaser -h

Setup Node.js Project

This composite action includes the following actions:

  • actions/setup-node
  • actions/cache

Definition: setup-node/action.yml

name: CI

on:
  push:
  pull_request:

jobs:
  test:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v3

      - uses: peaceiris/workflows/[email protected]
        with:
          node-version: '16.14.2'
          # node-version-file: '.nvmrc'

      - run: node -v
      - run: npm -v

Setup Python Project

This composite action includes the following actions:

  • actions/setup-python
  • actions/cache

Definition: setup-python/action.yml

name: CI

on:
  push:
  pull_request:

jobs:
  test:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v3

      - uses: peaceiris/workflows/[email protected]
        with:
          python-version: '3.10'

      - run: python3 -V
      - run: python3 -m pip -V
      - run: python3 -m pipenv --version

Setup Rust Project

This composite action includes the following actions:

  • actions/cache

Definition: setup-rust/action.yml

name: CI

on:
  push:
  pull_request:

jobs:
  test:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v3

      - uses: peaceiris/workflows/[email protected]

Install goreleaser to a GitHub Actions Ubuntu virtual environment.

Definition: setup-goreleaser/action.yml

Install the Latest Version

Here is an example GitHub Actions workflow to install the latest goreleaser and run it.

name: CI

on:
  push:
  pull_request:

jobs:
  test:
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@v3

      - uses: peaceiris/workflows/[email protected]

      - run: goreleaser -h
      - run: goreleaser check

Install a Specific Version

- uses: peaceiris/workflows/[email protected]
  with:
    goreleaser-version: '1.8.1'

Install mage to a GitHub Actions Ubuntu virtual environment.

Definition: setup-mage/action.yml

Install the Latest Version

Here is an example GitHub Actions workflow to install the latest mage and run it.

name: CI

on:
  push:
  pull_request:

jobs:
  test:
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@v3

      - uses: peaceiris/workflows/[email protected]

      - run: mage -h
      - run: mage fmt

Install a Specific Version

- uses: peaceiris/workflows/[email protected]
  with:
    mage-version: '1.10.0'

Reusable hadolint workflow

jobs:
  hadolint:
    uses: peaceiris/workflows/.github/workflows/[email protected]

Reusable actionlint workflow

jobs:
  actionlint:
    uses: peaceiris/workflows/.github/workflows/[email protected]

Reusable pull-request merger workflow

name: pull-request

on:
  issue_comment:
    types: [created, edited]

jobs:
  merger:
    uses: peaceiris/workflows/.github/workflows/[email protected]