-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (67 loc) · 2.67 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: "Continuous Integration"
on: [push]
jobs:
build:
name: "Build and Tests"
runs-on: ubuntu-22.04
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Set up JDK"
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: wrapper
# disable reading from cache on re-runs to fix possible caching issues
cache-write-only: ${{ fromJSON(github.run_attempt) != 1 }}
- name: "Build"
run: ./gradlew assemble publishToMavenLocal -Psigning.skip=true --scan --console=plain --build-cache
- name: "Test"
run: ./gradlew check --scan --console=plain --build-cache
- name: "Extract current version"
run: |
TCP_VERSION=$(./gradlew -q version)
echo "TCP_VERSION=$TCP_VERSION" >> "$GITHUB_ENV"
- name: Select assembly tests repo branch
run: |
echo "Check if the branch ${GITHUB_REF##*/} exists in assembly tests repo..."
EXISTS=$(git ls-remote --heads https://github.com/orange-buffalo/testcontainers-playwright-assembly-tests.git ${GITHUB_REF##*/})
if [[ $EXISTS ]]; then
echo "Will be using branch ${GITHUB_REF##*/} from assembly tests repo"
echo "ASSEMBLY_TESTS_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
else
echo "Branch ${GITHUB_REF##*/} does not exist in assembly tests repo, using master"
echo "ASSEMBLY_TESTS_BRANCH=master" >> $GITHUB_ENV
fi
- name: Checkout assembly tests repo
uses: actions/checkout@v4
with:
repository: orange-buffalo/testcontainers-playwright-assembly-tests
ref: ${{ env.ASSEMBLY_TESTS_BRANCH }}
fetch-depth: 0
path: ./.assembly-tests
- name: "Test assembly"
run: |
cd ./.assembly-tests
./gradlew test -PtestcontainersPlaywrightVersion=${{ env.TCP_VERSION }} --build-cache --scan
- name: "Publish snapshot"
if: ${{ github.actor != 'dependabot[bot]' }}
run: ./gradlew publish --scan --console=plain --build-cache
env:
ORG_GRADLE_PROJECT_ossrhSigningKey: "${{ secrets.ossrhSigningKey }}"
ORG_GRADLE_PROJECT_ossrhSigningPassword: "${{ secrets.ossrhSigningPassword }}"
ORG_GRADLE_PROJECT_ossrhPassword: "${{ secrets.ossrhPassword }}"
ORG_GRADLE_PROJECT_ossrhUser: "${{ secrets.ossrhUser }}"
- name: "Save Tests Results"
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: Tests Results
path: "**/build/reports/tests/**/"
if-no-files-found: "ignore"