Skip to content

Commit d9faaf9

Browse files
authored
Merge pull request #82 from my-dev-app/fix/unittest-placement
CHANGE: Unittests are now executed in the staging step
2 parents 350b3e4 + 3980400 commit d9faaf9

File tree

1 file changed

+54
-55
lines changed

1 file changed

+54
-55
lines changed

.github/workflows/entrypoint.yaml

Lines changed: 54 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
# Trigger build(s) on specified branch, git action:
66
pull_request:
77
types: [opened, closed, synchronize]
8-
branches:
8+
branches:
99
- 'development'
1010
- 'master'
1111

@@ -24,78 +24,77 @@ jobs:
2424
uses: ./.github/workflows/test_python_flake.yaml
2525
secrets: inherit
2626

27-
unittest:
28-
needs:
29-
- flake
30-
uses: ./.github/workflows/test_python_tests.yaml
31-
secrets: inherit
32-
3327
approve_development:
3428
needs:
3529
- flake
36-
- unittest
3730
uses: ./.github/workflows/auto_approve.yaml
3831
secrets: inherit
3932

40-
deployment_question:
33+
unittest:
4134
if: |
4235
github.event_name == 'pull_request' &&
4336
github.event.pull_request.merged == true &&
4437
github.ref == 'refs/heads/development' &&
4538
github.event.action == 'closed'
39+
uses: ./.github/workflows/test_python_tests.yaml
40+
secrets: inherit
41+
42+
deployment_question:
43+
needs:
44+
- unittest
4645
runs-on: self-hosted
4746
steps:
48-
- name: Checkout
49-
uses: actions/checkout@v3
50-
with:
51-
fetch-depth: 0
52-
- id: string
53-
uses: ASzc/change-string-case-action@v5
54-
with:
55-
string: ${{github.event.repository.name}}
56-
- name: Create Pull Request
57-
id: cpr
58-
uses: actions/github-script@v6
59-
with:
60-
script: |
61-
const { repo, owner } = context.repo;
62-
const result = await github.rest.pulls.create({
63-
title: 'Deploy A Proxy Relay Package? - ${{ github.run_number }}',
64-
owner,
65-
repo,
66-
head: '${{ github.ref_name }}',
67-
base: 'master',
68-
body: [
69-
'Would you like to release a new build of aproxyrelay ?\n',
70-
'Update A Proxy Relay to latest',
71-
'---',
72-
'Build and release new version!',
73-
].join('\n'),
74-
assignees: '@0x78f1935',
75-
reviewers: '@0x78f1935',
76-
});
77-
github.rest.issues.addLabels({
78-
owner,
79-
repo,
80-
issue_number: result.data.number,
81-
labels: ['docker', 'automated', 'prod-deployment'],
82-
});
83-
const os = require("os");
84-
const fs = require("fs");
47+
- name: Checkout
48+
uses: actions/checkout@v3
49+
with:
50+
fetch-depth: 0
51+
- id: string
52+
uses: ASzc/change-string-case-action@v5
53+
with:
54+
string: ${{github.event.repository.name}}
55+
- name: Create Pull Request
56+
id: cpr
57+
uses: actions/github-script@v6
58+
with:
59+
script: |
60+
const { repo, owner } = context.repo;
61+
const result = await github.rest.pulls.create({
62+
title: 'Deploy A Proxy Relay Package? - ${{ github.run_number }}',
63+
owner,
64+
repo,
65+
head: '${{ github.ref_name }}',
66+
base: 'master',
67+
body: [
68+
'Would you like to release a new build of aproxyrelay ?\n',
69+
'Update A Proxy Relay to latest',
70+
'---',
71+
'Build and release new version!',
72+
].join('\n'),
73+
assignees: '@0x78f1935',
74+
reviewers: '@0x78f1935',
75+
});
76+
github.rest.issues.addLabels({
77+
owner,
78+
repo,
79+
issue_number: result.data.number,
80+
labels: ['docker', 'automated', 'prod-deployment'],
81+
});
82+
const os = require("os");
83+
const fs = require("fs");
8584
86-
function setOutput(key, value) {
87-
// Temporary hack until core actions library catches up with github new recommendations
88-
const output = process.env['GITHUB_OUTPUT']
89-
fs.appendFileSync(output, `${key}=${value}${os.EOL}`)
90-
};
91-
setOutput('pr_id', result.data.number);
85+
function setOutput(key, value) {
86+
// Temporary hack until core actions library catches up with github new recommendations
87+
const output = process.env['GITHUB_OUTPUT']
88+
fs.appendFileSync(output, `${key}=${value}${os.EOL}`)
89+
};
90+
setOutput('pr_id', result.data.number);
9291
9392
deploy_package:
9493
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'prod-deployment')
9594
timeout-minutes: 30
9695
runs-on: self-hosted
9796
environment: production
98-
permissions:
97+
permissions:
9998
id-token: write
10099
contents: write
101100
pull-requests: write
@@ -126,8 +125,8 @@ jobs:
126125
id: release
127126
uses: ncipollo/release-action@v1
128127
with:
129-
artifacts: "dist/aproxyrelay-*.tar.gz,dist/aproxyrelay-*.whl"
130-
bodyFile: "README.md"
128+
artifacts: 'dist/aproxyrelay-*.tar.gz,dist/aproxyrelay-*.whl'
129+
bodyFile: 'README.md'
131130
generateReleaseNotes: true
132131
makeLatest: true
133132
token: ${{ secrets.PERSONAL_GITHUB_ACTIONS_TOKEN }}

0 commit comments

Comments
 (0)