generated from getsentry/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 53
89 lines (79 loc) · 2.91 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
83
84
85
86
87
88
89
name: "integration tests"
on:
pull_request:
paths-ignore:
- '**.md'
push:
branches:
- master
env:
# Variables defined in the repository
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
# For master we have an environment variable that selects the action-release project
# instead of action-release-prs
# For other branches: https://sentry-ecosystem.sentry.io/releases/?project=4505075304693760
# For master branch: https://sentry-ecosystem.sentry.io/releases/?project=6576594
SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }}
jobs:
# You're welcome to make changes on this job as part of your PR in order to test out your changes
# We can always undo the changes once we're satisfied with the results
#
# Secrets on this repo do not get shared with PRs opened on a fork, thus,
# add SENTRY_AUTH_TOKEN as a secret to your fork if you want to use this job.
# Checkout the README.md on how to create the internal integration (read: auth token)
create-real-release-per-push:
name: "Test current action"
runs-on: ubuntu-latest
# XXX: This job will fail for forks, skip step on forks and let contributors tweak it when ready
if: github.ref != 'refs/heads/master'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# For PRs, this supports creating a release using the commits from the branch (rather than the merge commit)
ref: ${{ github.event.pull_request.head.sha || github.sha }}
# This allows executing the action's code in the next step rather than a specific tag
- uses: './.github/actions/use-local-dockerfile'
- name: Create a staging release
uses: ./
env:
# If you want this step to be mocked you can uncomment this variable
# MOCK: true
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_LOG_LEVEL: debug
with:
ignore_missing: true
mock-release: # Make sure that the action works on a clean machine without building Docker
name: "Build image & mock a release"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: './.github/actions/use-local-dockerfile'
- name: Mock creating a Sentry release
uses: ./
env:
MOCK: true
with:
environment: production
mock-release-working-directory:
name: "Build image & mock a release in a different working directory"
runs-on: ubuntu-latest
steps:
- name: Checkout directory we'll be running from
uses: actions/checkout@v3
with:
path: main/
- name: Checkout directory we'll be testing
uses: actions/checkout@v3
with:
path: test/
- uses: './main/.github/actions/use-local-dockerfile'
with:
working_directory: main
- name: Mock creating a Sentry release in a different directory
uses: ./main
env:
MOCK: true
with:
environment: production
working_directory: ./test