-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (69 loc) · 2.47 KB
/
test.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
name: testing
on:
pull_request:
branches: [master]
workflow_dispatch:
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-22.04
environment: test-application
steps:
- name: Check out ${{ github.repository }}
uses: actions/checkout@v4
- name: Check out Devolutions/actions
uses: actions/checkout@v4
with:
repository: Devolutions/actions
ref: v1
token: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}
path: ./.github/workflows
- name: Get current version
id: get-version
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: Does tag exists?
uses: ./.github/workflows/tag-check
with:
github_token: ${{ github.token }}
tag: v${{ steps.get-version.outputs.version }}
- name: Setup Go environment
uses: actions/setup-go@v5
with:
go-version: '1.20'
check-latest: true
- name: Download CA certificate
uses: ./.github/workflows/create-file-from-secret
with:
content: ${{ secrets.DEVOLUTIONS_HQ_ISSUING_CA_PEM }}
path: ${{ runner.temp }}/certificate.pem
- name: Download test certificate
uses: ./.github/workflows/create-file-from-secret
with:
content: ${{ secrets.TEST_CERTIFICATE }}
path: ${{ runner.temp }}/test.p12
format: base64
- name: Update CA store
run: |
sudo cp ${{ runner.temp }}/certificate.pem /usr/local/share/ca-certificates/certificate.crt
sudo update-ca-certificates
- name: Connect to Tailscale
uses: ./.github/workflows/tailscale
with:
auth_key: ${{ secrets.TAILSCALE_AUTH_KEY_EPHEMERAL }}
exit_node: 100.99.49.20
accept_dns: true
- name: Test application
uses: ./.github/workflows/go-test
env:
TEST_USER: ${{ secrets.TEST_USER }}
TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }}
TEST_INSTANCE: ${{ secrets.TEST_INSTANCE }}
TEST_USER_ENTRY_ID: ${{ secrets.TEST_USER_ENTRY_ID }}
TEST_CERTIFICATE_ENTRY_ID: ${{ secrets.TEST_CERTIFICATE_ENTRY_ID }}
TEST_CERTIFICATE_FILE_PATH: '${{ runner.temp }}/test.p12'
TEST_VAULT_ID: ${{ secrets.TEST_VAULT_ID }}
TEST_WEBSITE_ENTRY_ID: ${{ secrets.TEST_WEBSITE_ENTRY_ID }}
with:
github_token: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}