-
Notifications
You must be signed in to change notification settings - Fork 4
46 lines (41 loc) · 1.42 KB
/
pr.yaml
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
# trunk-ignore-all(semgrep/yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha.third-party-action-not-pinned-to-commit-sha)
name: PR Testing
run-name: PR Checks for ${{ github.ref_name }}
on:
pull_request: {}
push:
branches:
- trunk-merge/**
jobs:
test:
name: run tests to validate pr
runs-on: ubicloud
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: robinraju/release-downloader@v1.9
with:
repository: trunk-io/mergequeue-tool
latest: true
tarBall: true
preRelease: true
extract: true
- name: Determine is_merge
id: check_is_merge
run: |
if [[ ${GITHUB_EVENT_NAME} == "push" && (${GITHUB_REF_NAME} == trunk-merge/* || ${GITHUB_REF_NAME} == trunk-merge-beta/*) || "${{ github.event.pull_request.title }}" == trunk-merge/* ]]; then
echo "on_merge=true" >> $GITHUB_OUTPUT
else
echo "on_merge=false" >> $GITHUB_OUTPUT
fi
- name: run tests
id: test
# only actually run the test if we're on the merge branch
# so we can simulate delay and flakiness
if: steps.check_is_merge.outputs.on_merge == 'true'
run: |
./mq test-sim
env:
IS_MERGE: ${{ steps.check_is_merge.outputs.on_merge }}