Skip to content

Commit 75c8e90

Browse files
consolidate actions into pr and have one set with old vars still (#211)
1 parent df1eeaa commit 75c8e90

File tree

3 files changed

+80
-118
lines changed

3 files changed

+80
-118
lines changed

.github/workflows/backward-compatibility.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Integration + Backward Compatibility Tests (Old Vars)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
jobs:
13+
integration-tests-oldvars:
14+
runs-on: ubuntu-latest
15+
16+
env:
17+
CONDUCTOR_SERVER_URL: ${{ secrets.CONDUCTOR_SERVER_URL }}
18+
CONDUCTOR_AUTH_KEY: ${{ secrets.KEY }}
19+
CONDUCTOR_AUTH_SECRET: ${{ secrets.SECRET }}
20+
21+
permissions:
22+
contents: read # minimal read access
23+
checks: write # needed for test report annotations
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
29+
- name: Set up Go
30+
uses: actions/setup-go@v3
31+
with:
32+
go-version: '1.23'
33+
34+
- name: Install dependencies
35+
run: go mod download
36+
37+
- name: Build
38+
run: go build ./...
39+
40+
- name: Install gotestsum
41+
run: go install gotest.tools/gotestsum@v1.12.0
42+
43+
- name: Run Integration tests (Old Vars)
44+
run: |
45+
gotestsum --format testname --junitfile report.xml -- -v ./test/integration_tests/...
46+
47+
- name: Publish test results (Old Vars)
48+
if: always()
49+
uses: dorny/test-reporter@v1
50+
with:
51+
name: Integration tests report (Old Vars)
52+
path: report.xml
53+
reporter: java-junit
54+
55+
- name: Run Backward Compatibility Tests (Old Vars)
56+
run: |
57+
echo "🚀 Starting Backward Compatibility Tests..."
58+
cd test/backward_compatibility
59+
chmod +x run_compatibility.sh
60+
./run_compatibility.sh
Lines changed: 20 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
1-
name: Integration Tests
1+
name: Integration + Backward Compatibility Tests
22

33
on:
4-
workflow_run:
5-
workflows: ["Build"]
6-
types:
7-
- completed
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
810
workflow_dispatch:
911

1012
jobs:
1113
integration-tests:
1214
runs-on: ubuntu-latest
13-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1415
env:
1516
CONDUCTOR_SERVER_URL: ${{ vars.SERVER_URL }}
1617
CONDUCTOR_AUTH_KEY: ${{ secrets.AUTH_KEY }}
1718
CONDUCTOR_AUTH_SECRET: ${{ secrets.AUTH_SECRET }}
18-
19+
20+
permissions:
21+
contents: read # minimal read access
22+
checks: write # needed for test report annotations
23+
1924
steps:
2025
- name: Checkout
2126
uses: actions/checkout@v3
22-
with:
23-
ref: ${{ github.event.workflow_run.head_sha }}
24-
repository: ${{ github.event.workflow_run.repository.full_name }}
2527

2628
- name: Set up Go
2729
uses: actions/setup-go@v3
@@ -41,49 +43,17 @@ jobs:
4143
run: |
4244
gotestsum --format testname --junitfile report.xml -- -v ./test/integration_tests/...
4345
44-
- name: Run Backward Compatibility Tests
45-
run: |
46-
echo "🚀 Starting Backward Compatibility Tests..."
47-
cd test/backward_compatibility
48-
chmod +x run_compatibility.sh
49-
./run_compatibility.sh
50-
51-
- name: Set PR Status to Failure
52-
if: ${{ failure() }}
53-
uses: actions/github-script@v6
54-
with:
55-
script: |
56-
const { owner, repo } = context.repo;
57-
const sha = context.payload.workflow_run.head_sha;
58-
await github.rest.repos.createCommitStatus({
59-
owner: owner,
60-
repo: repo,
61-
sha: sha,
62-
state: 'failure',
63-
context: 'Integration Tests',
64-
description: 'Integration tests failed.',
65-
});
66-
67-
- name: Set PR Status to Success
68-
if: ${{ success() }}
69-
uses: actions/github-script@v6
70-
with:
71-
script: |
72-
const { owner, repo } = context.repo;
73-
const sha = context.payload.workflow_run.head_sha;
74-
await github.rest.repos.createCommitStatus({
75-
owner: owner,
76-
repo: repo,
77-
sha: sha,
78-
state: 'success',
79-
context: 'Integration Tests',
80-
description: 'Integration tests succeeded.',
81-
});
82-
8346
- name: Publish test results
84-
if: always()
47+
if: always()
8548
uses: dorny/test-reporter@v1
8649
with:
8750
name: Integration tests report
8851
path: report.xml
8952
reporter: java-junit
53+
54+
- name: Run Backward Compatibility Tests
55+
run: |
56+
echo "🚀 Starting Backward Compatibility Tests..."
57+
cd test/backward_compatibility
58+
chmod +x run_compatibility.sh
59+
./run_compatibility.sh

0 commit comments

Comments
 (0)