-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- better actions test output - added fd | fd-find
- Loading branch information
Phillip Miller
committed
Dec 29, 2021
1 parent
39d53c5
commit c2334f8
Showing
7 changed files
with
135 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,19 @@ | ||
# This is a basic workflow | ||
|
||
name: CI | ||
|
||
# Controls when the action will run. Triggers the workflow on push with tags | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
pull_request: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# The "build" workflow | ||
build: | ||
# The type of runner that the job will run on | ||
strategy: | ||
matrix: | ||
go-version: [1.17.x] | ||
os: [ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
|
||
# Setup Go | ||
|
@@ -32,46 +23,117 @@ jobs: | |
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Cache Go modules | ||
uses: actions/cache@preview | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.OS }}-build-${{ env.cache-name }}- | ||
${{ runner.OS }}-build- | ||
${{ runner.OS }}- | ||
# Install all the dependencies | ||
- name: Install dependencies | ||
run: | | ||
go version | ||
go get -u golang.org/x/lint/golint | ||
go get github.com/mattn/[email protected] | ||
run: go get github.com/mattn/[email protected] | ||
|
||
# Run build of the application | ||
- name: Run build | ||
run: | | ||
go env -w GOFLAGS=-mod=mod | ||
go mod tidy | ||
go build -v . | ||
make -f MakeFile build | ||
# Run pimp-my-shell | ||
- name: Run pimp-my-shell | ||
run: | | ||
./pimp-my-shell | ||
cat "$HOME/.zshrc" | ||
test: | ||
strategy: | ||
matrix: | ||
go-version: [1.17.x] | ||
os: [ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Setup Go | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Cache Go modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
key: ${{ runner.os }}-test-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.OS }}-test-${{ env.cache-name }}- | ||
${{ runner.OS }}-test- | ||
${{ runner.OS }}- | ||
- name: Install dependencies | ||
run: go get github.com/mattn/[email protected] | ||
|
||
# Run Tests | ||
- name: Tests | ||
run: | | ||
make -f MakeFile test || true | ||
# Upload the original go test log as an artifact for later review. | ||
- name: Upload test log | ||
uses: actions/upload-artifact@v2 | ||
if: always() | ||
with: | ||
name: test-log | ||
path: /tmp/gotest.log | ||
if-no-files-found: error | ||
|
||
run-pimp-my-shell: | ||
strategy: | ||
matrix: | ||
go-version: [1.17.x] | ||
os: [ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Cache Go modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
key: ${{ runner.os }}-run-pimp-my-shell-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.OS }}-run-pimp-my-shell-${{ env.cache-name }}- | ||
${{ runner.OS }}-run-pimp-my-shell- | ||
${{ runner.OS }}- | ||
- name: Install dependencies | ||
run: go get github.com/mattn/[email protected] | ||
|
||
- name: Run pimp-my-shell | ||
run: | | ||
echo "::group::Pimp My Shell" | ||
./pimp-my-shell | ||
echo "::endgroup::" | ||
echo "::group::Final ZSHRC" | ||
cat "$HOME/.zshrc" | ||
echo "::endgroup::" | ||
generate-milestone: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # Required due to the weg Git works, without it this action won't be able to find any or the correct tags | ||
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags | ||
- name: Get Previous tag | ||
id: previoustag | ||
uses: WyriHaximus/github-action-get-previous-tag@v1 | ||
|
@@ -96,7 +158,7 @@ jobs: | |
# only runs on push "v*" tag | ||
# ================ | ||
release: | ||
needs: build | ||
needs: [build, test, run-pimp-my-shell] | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -105,41 +167,36 @@ jobs: | |
with: | ||
fetch-depth: 1000 | ||
|
||
# Setup Go | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17.x | ||
|
||
- name: Cache Go modules | ||
uses: actions/cache@preview | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }} | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
key: ${{ runner.os }}-release-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.OS }}-build-${{ env.cache-name }}- | ||
${{ runner.OS }}-build- | ||
${{ runner.OS }}-release-${{ env.cache-name }}- | ||
${{ runner.OS }}-release- | ||
${{ runner.OS }}- | ||
# Install all the dependencies | ||
- name: Install dependencies | ||
run: | | ||
go version | ||
go get github.com/mattn/[email protected] | ||
run: go get github.com/mattn/[email protected] | ||
|
||
# Run build of the application | ||
- name: Run build and MakeFile | ||
- name: Generate Binaries | ||
id: binaries | ||
run: | | ||
go env -w GOFLAGS=-mod=mod | ||
go mod tidy | ||
go build -v . | ||
make -f MakeFile release | ||
- name: Get current tag name | ||
run: | | ||
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | ||
echo "PREVIOUS_TAG=$(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1))" >> $GITHUB_ENV | ||
- name: "Build Changelog" | ||
id: github_release | ||
uses: mikepenz/release-changelog-builder-action@v1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters