-
Notifications
You must be signed in to change notification settings - Fork 1
102 lines (97 loc) · 3.38 KB
/
development.yml
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
90
91
92
93
94
95
96
97
98
99
100
101
102
name: "Continuous Integration"
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: "Build code"
runs-on: ubuntu-latest
steps:
- name: "Checkout sources"
uses: actions/checkout@v2
- name: "Cache dependencies"
uses: actions/cache@v2
with:
path: |
~/.gradle
${GITHUB_WORKSPACE}/.gradle
~/.cache/pip/
key: ${{ runner.os }}-devex-development-java16-graal-21.3.0-r17
- name: "Install GraalVM"
uses: DeLaGuardo/[email protected]
with:
graalvm: '21.3.0'
java: 'java17'
arch: 'amd64'
- name: "Install native-image"
run: |
gu install native-image
- name: "Install Terraform"
uses: autero1/[email protected]
with:
terraform_version: 1.0.8
- name: "Setup SSH"
run: |
mkdir -p ~/.ssh
cat .github/files/known_hosts > ~/.ssh/known_hosts
echo "${bot_devex_ssh_private_key_rsa}" > ~/.ssh/id_rsa
echo "${bot_devex_ssh_private_key_ed25519}" > ~/.ssh/id_ed25519
cat << EOF > ~/.ssh/config
Host gitlab.com
IdentityFile ~/.ssh/id_ed25519
Host github.com
IdentityFile ~/.ssh/id_rsa
EOF
chmod -R 500 ~/.ssh
env:
bot_devex_ssh_private_key_rsa: ${{ secrets.BOT_DEVEX_SSH_PRIVATE_KEY_RSA }}
bot_devex_ssh_private_key_ed25519: ${{ secrets.BOT_DEVEX_SSH_PRIVATE_KEY_ED25519 }}
- name: "Gradle build"
run: ./gradlew build
env:
GITLAB_TOKEN: ${{ secrets.BOT_GITLAB_TOKEN_READ_API }}
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN_READ_ORG_AND_REPO }}
- name: "Upload Test Reports"
uses: actions/[email protected]
if: failure()
with:
name: test-reports
path: build/reports/tests
retention-days: 5
- name: "Publish Unit Test Results"
uses: EnricoMi/publish-unit-test-result-action/composite@v1
if: always()
with:
files: build/test-results/test/*.xml
- name: "Create native-image build config"
run: |
.github/scripts/create-native-image-build-config.sh
.github/scripts/merge-native-image-build-config.sh linux
env:
GITLAB_TOKEN: ${{ secrets.BOT_GITLAB_TOKEN_READ_API }}
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN_READ_ORG_AND_REPO }}
- name: "Gradle nativeImage"
run: ./gradlew nativeImage
env:
GITLAB_TOKEN: ${{ secrets.BOT_GITLAB_TOKEN_READ_API }}
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN_READ_ORG_AND_REPO }}
- name: "Run and test native binary"
run: .github/scripts/run-native-binary.sh
env:
GITLAB_TOKEN: ${{ secrets.BOT_GITLAB_TOKEN_READ_API }}
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN_READ_ORG_AND_REPO }}
- uses: EndBug/add-and-commit@v7 # You can change this to use a specific version
with:
add: "src/main/resources/META-INF/native-image"
author_name: "DevEx Bot"
author_email: "[email protected]"
default_author: "user_info"
message: "Update native-image build config"
branch: ${{ github.head_ref }}
- name: "Clean up"
if: ${{ always() }}
run: sudo rm -rf ~/.ssh