Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
accf0905
Unverified
Commit
accf0905
authored
Jul 07, 2023
by
Zach Pomerantz
Committed by
GitHub
Jul 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build: block promotion on Test (#6898)
parent
ef5065de
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
1-main-to-staging.yml
.github/workflows/1-main-to-staging.yml
+15
-0
test.yml
.github/workflows/test.yml
+4
-3
No files found.
.github/workflows/1-main-to-staging.yml
View file @
accf0905
...
@@ -14,6 +14,21 @@ jobs:
...
@@ -14,6 +14,21 @@ jobs:
environment
:
environment
:
name
:
push/staging
name
:
push/staging
steps
:
steps
:
-
name
:
Check test status
uses
:
actions/github-script@v6.4.1
with
:
script
:
|
const statuses = await github.rest.repos.listCommitStatusesForRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: context.payload.head_commit.sha
})
const status = statuses.data.find(status => status.context === 'Test / promotion')?.state || 'missing'
core.info('Status: ' + status)
if (status !== 'success') {
core.setFailed('"Test / promotion" must be successful before pushing')
}
-
uses
:
actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
-
uses
:
actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
with
:
with
:
token
:
${{ secrets.RELEASE_SERVICE_ACCESS_TOKEN }}
token
:
${{ secrets.RELEASE_SERVICE_ACCESS_TOKEN }}
...
...
.github/workflows/test.yml
View file @
accf0905
...
@@ -169,6 +169,7 @@ jobs:
...
@@ -169,6 +169,7 @@ jobs:
SLACK_WEBHOOK_URL
:
${{ secrets.SLACK_TEST_REPORTER_WEBHOOK }}
SLACK_WEBHOOK_URL
:
${{ secrets.SLACK_TEST_REPORTER_WEBHOOK }}
pre
:
pre
:
if
:
${{ github.ref_name == 'main' || github.ref_name == 'releases/staging' }}
runs-on
:
ubuntu-latest
runs-on
:
ubuntu-latest
steps
:
steps
:
-
uses
:
actions/github-script@v6.4.1
-
uses
:
actions/github-script@v6.4.1
...
@@ -177,7 +178,7 @@ jobs:
...
@@ -177,7 +178,7 @@ jobs:
github.rest.repos.createCommitStatus({
github.rest.repos.createCommitStatus({
owner: context.repo.owner,
owner: context.repo.owner,
repo: context.repo.repo,
repo: context.repo.repo,
sha: context.payload.
pull_request.head.sha || context.payload.
head_commit.sha,
sha: context.payload.head_commit.sha,
state: 'pending',
state: 'pending',
context: 'Test / promotion',
context: 'Test / promotion',
description: 'Running tests...',
description: 'Running tests...',
...
@@ -185,7 +186,7 @@ jobs:
...
@@ -185,7 +186,7 @@ jobs:
})
})
post
:
post
:
if
:
always()
if
:
${{ github.ref_name == 'main' || github.ref_name == 'releases/staging' }}
needs
:
[
pre
,
lint
,
typecheck
,
deps-tests
,
unit-tests
,
cypress-test-matrix
]
needs
:
[
pre
,
lint
,
typecheck
,
deps-tests
,
unit-tests
,
cypress-test-matrix
]
runs-on
:
ubuntu-latest
runs-on
:
ubuntu-latest
steps
:
steps
:
...
@@ -195,7 +196,7 @@ jobs:
...
@@ -195,7 +196,7 @@ jobs:
github.rest.repos.createCommitStatus({
github.rest.repos.createCommitStatus({
owner: context.repo.owner,
owner: context.repo.owner,
repo: context.repo.repo,
repo: context.repo.repo,
sha: context.payload.
pull_request.head.sha || context.payload.
head_commit.sha,
sha: context.payload.head_commit.sha,
state: ${{ env.STATUS }} ? 'success' : 'failure',
state: ${{ env.STATUS }} ? 'success' : 'failure',
context: 'Test / promotion',
context: 'Test / promotion',
description: ${{ env.STATUS }} ? 'All tests passed' : 'One or more tests failed and are blocking promotion',
description: ${{ env.STATUS }} ? 'All tests passed' : 'One or more tests failed and are blocking promotion',
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment