-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Extend the CI workflow to test on Windows and MacOS - Add missing Close() calls when opening the temporary test files - Fix test with relative paths on different drives. On the Windows GitHub runners the cache directory is on drive C and the current working directory is on drive D which makes the relative path resolution fail.
- Loading branch information
Showing
8 changed files
with
93 additions
and
20 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 |
---|---|---|
|
@@ -3,6 +3,7 @@ on: [push] | |
|
||
env: | ||
UIPATHCLI_BASE_VERSION: "v1.1" | ||
GO_VERSION: "1.22.2" | ||
|
||
jobs: | ||
build: | ||
|
@@ -17,22 +18,39 @@ jobs: | |
- name: Setup go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.22.2' | ||
go-version: ${{ env.GO_VERSION }} | ||
cache: true | ||
- name: Version | ||
id: version | ||
run: | | ||
UIPATHCLI_VERSION=$(./version.sh "$UIPATHCLI_BASE_VERSION") | ||
echo "UIPATHCLI_VERSION=$(echo $UIPATHCLI_VERSION)" >> $GITHUB_ENV | ||
echo "UIPATHCLI_VERSION=$(echo $UIPATHCLI_VERSION)" >> $GITHUB_OUTPUT | ||
- name: Install dependencies | ||
run: go get . | ||
- name: Build | ||
run: go build -ldflags="-X github.com/UiPath/uipathcli/commandline.Version=$UIPATHCLI_VERSION" . | ||
- name: Lint | ||
run: | | ||
go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
golangci-lint run | ||
- name: Package | ||
run: ./build.sh && ./package.sh | ||
- name: Upload packages | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: packages | ||
path: build/packages/ | ||
if-no-files-found: error | ||
|
||
test_linux: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
cache: true | ||
- name: Test | ||
run: go test -coverprofile="coverage.out" -coverpkg "$(go list github.com/UiPath/uipathcli/... | grep -v 'test' | tr '\n' ',')" ./... | ||
- name: Coverage | ||
|
@@ -41,17 +59,35 @@ jobs: | |
run: | | ||
go install github.com/mattn/goveralls@latest | ||
goveralls -coverprofile="coverage.out" -service="github" | ||
- name: Package | ||
run: ./build.sh && ./package.sh | ||
- name: Upload packages | ||
uses: actions/upload-artifact@v4 | ||
test_windows: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup go | ||
uses: actions/setup-go@v5 | ||
with: | ||
name: packages | ||
path: build/packages/ | ||
if-no-files-found: error | ||
go-version: ${{ env.GO_VERSION }} | ||
cache: true | ||
- name: Test | ||
run: go test ./... | ||
|
||
test_macos: | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
cache: true | ||
- name: Test | ||
run: go test ./... | ||
|
||
publish_pages: | ||
needs: build | ||
needs: [build, test_linux, test_windows, test_macos] | ||
permissions: | ||
pages: write | ||
id-token: write | ||
|
@@ -79,7 +115,7 @@ jobs: | |
uses: actions/deploy-pages@v4 | ||
|
||
release: | ||
needs: build | ||
needs: [build, test_linux, test_windows, test_macos] | ||
if: github.ref == 'refs/heads/main' | ||
runs-on: ubuntu-latest | ||
env: | ||
|
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 |
---|---|---|
|
@@ -4,4 +4,5 @@ uipathcli | |
build/ | ||
coverage.out | ||
coverage.html | ||
bin/ | ||
bin/ | ||
tmp/ |
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
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