Skip to content

Commit

Permalink
Migrate tests to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
yahavi committed Sep 29, 2023
1 parent 102bee9 commit 157611e
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 30 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: 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.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Tests:
if: contains(github.event.pull_request.labels.*.name, 'safe to test') || github.event_name == 'push'
name: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu, windows, macOS ]
include:
- os: windows
gradlewSuffix: .bat
runs-on: ${{ matrix.os }}-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Artifactory
run: |
go install github.com/jfrog/jfrog-testing-infra/local-rt-setup@latest
~/go/bin/local-rt-setup
env:
RTLIC: ${{secrets.RTLIC}}
GOPROXY: direct

- name: Install Java
uses: actions/setup-java@v3
with:
java-version: "8"
distribution: "temurin"

- name: Run Artifactory projects tests
run: ./gradlew${{ matrix.gradlewSuffix }} clean test
env:
CLIENTTESTS_ARTIFACTORY_URL: http://localhost:8081/artifactory
CLIENTTESTS_ARTIFACTORY_USERNAME: admin
CLIENTTESTS_ARTIFACTORY_PASSWORD: password
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

[![Scanned by Frogbot](https://raw.github.com/jfrog/frogbot/master/images/frogbot-badge.svg)](https://github.com/jfrog/frogbot#readme)

|Branch|Status|
|:---:|:---:|
|master|[![Build status](https://ci.appveyor.com/api/projects/status/sarjlbpi6dfgrd5w/branch/master?svg=true)](https://ci.appveyor.com/project/jfrog-ecosystem/artifactory-client-java/branch/master)
|dev|[![Build status](https://ci.appveyor.com/api/projects/status/sarjlbpi6dfgrd5w/branch/dev?svg=true)](https://ci.appveyor.com/project/jfrog-ecosystem/artifactory-client-java/branch/dev)
| Branch |Status|
|:------:|:---:|
|master|[![Test](https://github.com/jfrog/artifactory-client-java/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/jfrog/artifactory-client-java/actions/workflows/tests.yml?query=branch%3Amaster)
|dev|[![Test](https://github.com/jfrog/artifactory-client-java/actions/workflows/tests.yml/badge.svg?branch=dev)](https://github.com/jfrog/artifactory-client-java/actions/workflows/tests.yml?query=branch%3Adev)

</div>

Expand Down
20 changes: 0 additions & 20 deletions ci/appveyor.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ public void testErrorStreamingRestCall() throws IOException {
assertFalse(response.isSuccessResponse());
assertEquals(response.getStatusLine().getStatusCode(), 404);
String raw = IOUtils.toString(response.getInputStream(), StandardCharsets.UTF_8);
assertEquals(raw, "{\n" +
" \"errors\" : [ {\n" +
" \"status\" : 404,\n" +
" \"message\" : \"File not found.\"\n" +
" } ]\n" +
"}");
assertTrue(raw.contains("File not found"), "Expected response to contain 'File not found'.\nResponse:" + raw);
}
}

0 comments on commit 157611e

Please sign in to comment.