Support Lifecycle Release Bundle Distribute #1273
Workflow file for this run
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
name: JFrog Client Go Tests | |
on: | |
push: | |
branches: | |
- '**' | |
tags-ignore: | |
- '**' | |
# Triggers the workflow on labeled PRs only. | |
pull_request_target: | |
types: [ labeled ] | |
# Ensures that only the latest commit is running for each PR at a time. | |
# Ignores this rule for push events. | |
concurrency: | |
group: ${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
Pretest: | |
if: contains(github.event.pull_request.labels.*.name, 'safe to test') || github.event_name == 'push' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Unlabel 'safe to test' | |
uses: actions-ecosystem/action-remove-labels@v1 | |
if: ${{github.event_name != 'push' }} | |
with: | |
labels: "safe to test" | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.20.x | |
- name: Go Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: ${{ runner.os }}-go- | |
- name: Lint | |
run: go vet -v ./... | |
JFrog-Client-Go-Artifactory-Access-Tests: | |
name: ${{ matrix.suite }} ${{ matrix.os }} | |
needs: Pretest | |
strategy: | |
fail-fast: false | |
matrix: | |
suite: [ artifactory, access ] | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.20.x | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Go Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: ${{ runner.os }}-go- | |
- name: Setup Artifactory | |
env: | |
setup-url: github.com/jfrog/jfrog-testing-infra/local-rt-setup@latest | |
RTLIC: ${{secrets.RTLIC}} | |
GOPROXY: direct | |
run: | | |
go install ${{ env.setup-url }} || go install ${{ env.setup-url }} | |
~/go/bin/local-rt-setup | |
- name: artifactory tests | |
run: go test -v github.com/jfrog/jfrog-client-go/tests --timeout 0 --test.${{ matrix.suite }} --ci.runId=${{ runner.os }}-${{ matrix.suite }} | |
JFrog-Client-Go-Ds-Xr-Tests: | |
needs: Pretest | |
name: ${{ matrix.suite }} ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
suite: [ distribution, xray ] | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.20.x | |
- name: Go Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: ${{ runner.os }}-go- | |
- name: ${{ matrix.suite }} tests | |
run: go test -v github.com/jfrog/jfrog-client-go/tests --timeout 0 --test.${{ matrix.suite }} --rt.url=${{ secrets.PLATFORM_URL }}/artifactory --ds.url=${{ secrets.PLATFORM_URL }}/distribution --xr.url=${{ secrets.PLATFORM_URL }}/xray --access.url=${{ secrets.PLATFORM_URL }}/access --rt.user=${{ secrets.PLATFORM_USER }} --rt.password=${{ secrets.PLATFORM_PASSWORD }} --access.token=${{ secrets.PLATFORM_ADMIN_TOKEN }} --ci.runId=${{ runner.os }}-${{ matrix.suite }} | |
JFrog-Client-Go-Pipelines-Tests: | |
needs: Pretest | |
name: pipelines ubuntu-latest | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.20.x | |
- name: Go Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: ${{ runner.os }}-go- | |
- name: pipelines tests | |
run: go test -v github.com/jfrog/jfrog-client-go/tests --timeout 0 --test.pipelines --rt.url=${{ secrets.PLATFORM_URL }}/artifactory --pipe.url=${{ secrets.PLATFORM_URL }}/pipelines --rt.user=${{ secrets.PLATFORM_USER }} --rt.password=${{ secrets.PLATFORM_PASSWORD }} --pipe.accessToken=${{ secrets.PLATFORM_ADMIN_TOKEN }} --pipe.vcsToken=${{ secrets.CLI_PIPE_VCS_TOKEN }} --pipe.vcsRepo=${{ secrets.CLI_PIPE_VCS_REPO }} --pipe.vcsBranch=${{ secrets.CLI_PIPE_VCS_BRANCH }} --ci.runId=${{ runner.os }}_pipe | |
JFrog-Client-Go-Repositories-Tests: | |
needs: Pretest | |
name: repositories ubuntu-latest | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.20.x | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Go Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: ${{ runner.os }}-go- | |
- name: Setup Artifactory | |
env: | |
setup-url: github.com/jfrog/jfrog-testing-infra/local-rt-setup@latest | |
RTLIC: ${{secrets.RTLIC}} | |
GOPROXY: direct | |
run: | | |
go install ${{ env.setup-url }} || go install ${{ env.setup-url }} | |
~/go/bin/local-rt-setup | |
- name: Repositories tests | |
run: go test -v github.com/jfrog/jfrog-client-go/tests --timeout 0 --test.repositories |