-
Notifications
You must be signed in to change notification settings - Fork 11
75 lines (72 loc) · 2.8 KB
/
feature-test-2gp.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
name: 2GP Feature Test
on:
workflow_call:
inputs:
debug:
required: false
default: false
type: boolean
secrets:
# Either dev-hub-auth-url or dev-hub-username, dev-hub-client-id, and dev-hub-private-key are required
dev-hub-auth-url:
required: false
dev-hub-username:
required: false
dev-hub-client-id:
required: false
dev-hub-private-key:
required: false
gh-email:
required: true
github-token:
required: true
jobs:
feature-test:
name: "2GP Feature Test"
runs-on: ubuntu-latest
container:
image: ghcr.io/muselab-d2x/d2x:latest
options: --user root
credentials:
username: "${{ github.actor }}"
password: "${{ secrets.github-token }}"
env:
DEV_HUB_AUTH_URL: "${{ secrets.dev-hub-auth-url }}"
DEV_HUB_USERNAME: "${{ secrets.dev-hub-username }}"
DEV_HUB_CLIENT_ID: "${{ secrets.dev-hub-client-id }}"
DEV_HUB_PRIVATE_KEY: "${{ secrets.dev-hub-private-key }}"
CUMULUSCI_SERVICE_github: "{ \"username\": \"${{ github.actor }}\", \"token\": \"${{ secrets.github-token }}\", \"email\": \"${{ secrets.gh-email }}\" }"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Auth to DevHub
run: /usr/local/bin/devhub.sh
- name: Set feature org as default org
run: cci org default feature
- name: Build Feature Test Package
env:
GITHUB_TOKEN: '${{ secrets.github-token }}'
run: cci flow run build_feature_test_package $([[ "${{ inputs.debug }}" == "true" ]] && echo " --debug") | tee cumulusci-flow.log
shell: bash
- name: Set Commit Status
env:
GITHUB_TOKEN: '${{ secrets.github-token }}'
run: |
VERSION=$(cat cumulusci-flow.log | grep -o -E -m 1 "04t[a-zA-Z0-9]{15}")
gh api \
--method POST \
-H "Accept: application/vnd.github.v3+json" \
'/repos/${{ github.repository }}/statuses/${{ github.sha }}' \
-f state='success' \
-f description="version_id: $VERSION" \
-f context='Build Feature Test Package'
shell: bash
- name: Run Feature Test
env:
GITHUB_TOKEN: '${{ secrets.github-token }}'
run: cci flow run ci_feature_2gp
- name: Delete Scratch Org
if: ${{ always() }}
run: |
cci org scratch_delete feature
shell: bash