-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #336 from warrensbox/master
Testing new pipeline
- Loading branch information
Showing
19 changed files
with
451 additions
and
1,006 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Run test | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' # matches every branch that doesn't contain a '/' | ||
- '*/*' # matches every branch containing a single '/' | ||
- '**' # matches every branch | ||
- '!master' # excludes master | ||
jobs: | ||
|
||
integration_tests_linux: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
go_version: ['1.22'] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go_version }} | ||
|
||
- name: Build code | ||
run: go build -v ./... | ||
|
||
- name: Running test | ||
run: | | ||
set -e | ||
go get -v -t -d ./... | ||
go vet -tests=false ./... | ||
go test -v ./... | ||
mkdir -p build | ||
go build -v -o build/tfswitch | ||
mkdir `pwd`/bin/ | ||
find ./test-data/* -type d -print0 | while read -r -d $'\0' TEST_PATH; do | ||
./build/tfswitch -c "${TEST_PATH}" -b `pwd`/bin/terraform || exit 1 | ||
done | ||
integration_tests_windows: | ||
strategy: | ||
matrix: | ||
os: [windows-latest] | ||
go_version: ['1.22'] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go_version }} | ||
|
||
- name: Build code | ||
run: go build -v ./... | ||
|
||
- name: Running test | ||
run: | | ||
go test -v ./... |
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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Trigger when commits are pushed to the master branch | ||
# Trigger when MR to master is closed | ||
|
||
name: Build-Test-Release Code | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- release | ||
|
||
|
||
jobs: | ||
hubapp-release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
# Checkout code from repo | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.sha }} # required for better experience using pre-releases | ||
fetch-depth: '0' | ||
|
||
# Install go | ||
- name: Checkout go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.22' # The Go version to download (if necessary) and use. | ||
|
||
# Double check go version | ||
- name: Go version | ||
id: Version | ||
run: go version | ||
|
||
# Download dependencies | ||
- name: Go download | ||
run: go mod download | ||
|
||
# Test to see if tfswitch works with --help | ||
- name: Go build | ||
run: mkdir -p build && go build -v -o build/tfswitch && build/tfswitch --help | ||
continue-on-error: false | ||
|
||
# Introduce new tag | ||
- name: Bump version and push tag | ||
uses: anothrNick/[email protected] | ||
id: tagging | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
WITH_V: false | ||
INITIAL_VERSION: 1.0.0 | ||
RELEASE_BRANCHES: release | ||
DEFAULT_BUMP: patch | ||
PRERELEASE: false | ||
DRY_RUN: false | ||
VERBOSE: true | ||
|
||
# Run goreleaser to create new binaries | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
RELEASE_VERSION: ${{ steps.tagging.outputs.tag }} | ||
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install mkdocs-material | ||
- name: Build page | ||
run: cd www && mkdocs gh-deploy --force | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
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
Oops, something went wrong.