Repository navigation
89 lines (88 loc) · 3.03 KB
/
Copy pathgithub-actions.yml
File metadata and controls
89 lines (88 loc) · 3.03 KB
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
82
83
84
85
86
87
88
89
# Maven
# Build your Java project and run tests with Apache Maven.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java
on:
workflow_dispatch:
push:
branches:
- '*'
paths-ignore:
- README.md
- gh-pages
tags:
- '*'
schedule:
- cron: '0 19 * * 0'
jobs:
build:
runs-on: ubuntu-latest
env:
dBTestCompareVersion: 2.0.0
steps:
- uses: actions/checkout@v4
- name: Install Docker Compose and Ant
run: |
sudo apt-get update
sudo apt-get install -y docker-compose ant
- shell: pwsh
run: |
$tags = git tag --sort=-creatordate
$tag = $tags[0]
Write-Host "##vso[task.setvariable variable=dBTestCompareVersion]$tag"
if: startsWith(github.ref, 'refs/tags/')
- shell: pwsh
run: |
./setDBTestCompareVersion.ps1
- shell: pwsh
run: |
./downloadBackupAndJDBCDrivers.ps1
- name: Start databases (retry on public.ecr.aws rate limiting)
shell: bash
run: |
for i in 1 2 3 4 5; do
docker-compose -f "./docker/docker-compose.yml" up -d && exit 0
echo "compose up attempt $i failed (likely toomanyrequests); retrying in 30s..."
sleep 30
done
echo "compose up failed after 5 attempts" >&2
exit 1
- shell: pwsh
run: |
./restoreBackup.ps1
- name: Run ant build
run: ant -noinput -buildfile ./deploy/build.xml -Dconfig=DEV02 compile tokens.copy.files testdbq.run
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/linux@v2
if: success() || failure()
with:
files: '**/TEST-*.xml'
report_individual_runs: true
- shell: pwsh
run: |
./copyArtifact.ps1
- uses: actions/upload-artifact@v4
with:
name: DBTestCompare${{ env.dBTestCompareVersion }}.TestResults.${{github.run_number}}
path: ./target/test-output
- uses: actions/upload-artifact@v4
with:
name: DBTestCompare${{ env.dBTestCompareVersion }}.TestDefinitionsResults.${{github.run_number}}
path: ./target/test-definitions
- uses: actions/upload-artifact@v4
with:
name: DBTestCompare${{ env.dBTestCompareVersion }}
path: ./release
- shell: pwsh
run: compress-archive -path "./release" ./release/DBTestCompare${{ env.dBTestCompareVersion }}.zip
- shell: pwsh
run: Copy './release/DBTestCompare${{ env.dBTestCompareVersion }}.zip' '${{ github.workspace }}'
- shell: bash
run: |
upload_url=$(curl -sL https://api.github.com/repos/Accenture/DBTestCompare/releases/latest | jq -r '.upload_url')
echo UPLOAD_URL=$upload_url >> $GITHUB_ENV
- name: 'Upload linux artifact to Release'
run: gh release upload ${{ env.dBTestCompareVersion }} ./release/DBTestCompare${{ env.dBTestCompareVersion }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')