Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gha: switch to composite running mode and set up cache #150

Merged
merged 1 commit into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
45 changes: 36 additions & 9 deletions dependency/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,39 @@ inputs:
required: false
default: check
runs:
using: docker
image: ../Dockerfile
args:
- -v
- ${{ inputs.log }}
- -c
- ${{ inputs.config }}
- dependency
- ${{ inputs.mode }}
using: "composite"
steps:
- name: Set up Go 1.18
uses: actions/setup-go@v2
with:
go-version: 1.18
- if: runner.os == 'Linux'
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: license-eye-${{ runner.os }}-go-${{ hashFiles(format('{0}/{1}', github.action_path, 'go.sum')) }}
restore-keys: license-eye-${{ runner.os }}-go-
- if: runner.os == 'macOS'
uses: actions/cache@v3
with:
path: |
~/Library/Caches/go-build
~/go/pkg/mod
key: license-eye-${{ runner.os }}-go-${{ hashFiles(format('{0}/{1}', github.action_path, 'go.sum')) }}
restore-keys: license-eye-${{ runner.os }}-go-
- if: runner.os == 'Windows'
uses: actions/cache@v3
with:
path: |
~\AppData\Local\go-build
~\go\pkg\mod
key: license-eye-${{ runner.os }}-go-${{ hashFiles(format('{0}/{1}', github.action_path, 'go.sum')) }}
restore-keys: license-eye-${{ runner.os }}-go-
- shell: bash
run: make -C $GITHUB_ACTION_PATH install
- shell: bash
env:
GITHUB_TOKEN: ${{ inputs.token }}
run: license-eye -v ${{ inputs.log }} -c ${{ inputs.config }} dependency ${{ inputs.mode }}
47 changes: 36 additions & 11 deletions header/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,39 @@ inputs:
required: false
default: check
runs:
using: docker
image: ../Dockerfile
env:
GITHUB_TOKEN: ${{ inputs.token }}
args:
- -v
- ${{ inputs.log }}
- -c
- ${{ inputs.config }}
- header
- ${{ inputs.mode }}
using: "composite"
steps:
- name: Set up Go 1.18
uses: actions/setup-go@v2
with:
go-version: 1.18
- if: runner.os == 'Linux'
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: license-eye-${{ runner.os }}-go-${{ hashFiles(format('{0}/{1}', github.action_path, 'go.sum')) }}
restore-keys: license-eye-${{ runner.os }}-go-
- if: runner.os == 'macOS'
uses: actions/cache@v3
with:
path: |
~/Library/Caches/go-build
~/go/pkg/mod
key: license-eye-${{ runner.os }}-go-${{ hashFiles(format('{0}/{1}', github.action_path, 'go.sum')) }}
restore-keys: license-eye-${{ runner.os }}-go-
- if: runner.os == 'Windows'
uses: actions/cache@v3
with:
path: |
~\AppData\Local\go-build
~\go\pkg\mod
key: license-eye-${{ runner.os }}-go-${{ hashFiles(format('{0}/{1}', github.action_path, 'go.sum')) }}
restore-keys: license-eye-${{ runner.os }}-go-
- shell: bash
run: make -C $GITHUB_ACTION_PATH install
- shell: bash
env:
GITHUB_TOKEN: ${{ inputs.token }}
run: license-eye -v ${{ inputs.log }} -c ${{ inputs.config }} header ${{ inputs.mode }}