-
Notifications
You must be signed in to change notification settings - Fork 18
55 lines (52 loc) · 1.92 KB
/
trunk-install-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
name: Trunk install test workflow
on:
workflow_dispatch:
schedule:
- cron: '0 12 * * *'
pull_request:
branches:
- main
paths:
- '.github/workflows/trunk-install-test.yml'
jobs:
test:
name: Run tests
runs-on:
- self-hosted
- dind
- large-8x8
container:
image: quay.io/tembo/trunk-test-tembo:f3b2a28-pg15
options: --user root
env:
PGHOST: "localhost"
PGPORT: "5432"
PGDATABASE: "postgres"
PGUSER: "postgres"
PGPASSWORD: "postgres"
POSTGRES_PASSWORD: "password"
steps:
- name: Install all extensions in registry
# Entrypoint is overwritten by GitHub Action. We need to execute it manually in order to start Postgres.
# More information here https://github.com/actions/runner/issues/1964
run: |
su postgres -c '/usr/lib/postgresql/15/bin/postgres &'
sleep 5
curl https://registry.pgtrunk.io/extensions/all | jq -r ".[] | .name" > /tmp/extensions.txt
trunk-install.sh | tee /tmp/output.txt
cat /tmp/output.txt | grep -i -A 1 'SUCCESS RATE' | grep -v 'SUCCESS RATE' > /tmp/results.txt
export RES=$(cat /tmp/results.txt)
echo "RESULTS=$RES" >> $GITHUB_ENV
# - name: Post to a Slack channel
# if: ${{ github.ref == 'refs/heads/main' }}
# id: slack
# uses: slackapi/[email protected]
# with:
# # Slack channel id, channel name, or user id to post message.
# # See also: https://api.slack.com/methods/chat.postMessage#channels
# # You can pass in multiple channels to post to by providing a comma-delimited list of channel IDs.
# channel-id: 'C05NVR28LA0'
# # For posting a simple plain text message
# slack-message: "Success rate:\n${{ env.RESULTS }}"
# env:
# SLACK_BOT_TOKEN: ${{ secrets.TRUNK_INSTALL_SLACK_BOT_TOKEN }}