mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-23 21:16:52 +01:00
Actions shouldn't be this fucking hard...
This commit is contained in:
@@ -198,13 +198,13 @@ jobs:
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
run: echo "::set-env name=TGS4_TEST_PULL_REQUEST_NUMBER::${{ github.event.number }}"
|
||||
|
||||
- name: Set TGS4_TEST_BRANCH to pull request base
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
run: echo "::set-env name=TGS4_TEST_BRANCH::${{ github.event.base_ref.substring('refs/heads/'.length) }}"
|
||||
- name: Set TGS4_GITHUB_REF for PR
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
run: echo "::set-env name=TGS4_GITHUB_REF::${{ github.event.base_ref }}"
|
||||
|
||||
- name: Set TGS4_TEST_BRANCH to pushed branch
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
run: echo "::set-env name=TGS4_TEST_BRANCH::${{ github.event.ref.substring('refs/heads/'.length) }}"
|
||||
- name: Set TGS4_GITHUB_REF for push
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
run: echo "::set-env name=TGS4_GITHUB_REF::${{ github.event.ref }}"
|
||||
|
||||
- name: Run Integration Test
|
||||
run: |
|
||||
@@ -340,13 +340,13 @@ jobs:
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
run: echo "::set-env name=TGS4_TEST_PULL_REQUEST_NUMBER::${{ github.event.number }}"
|
||||
|
||||
- name: Set TGS4_TEST_BRANCH to pull request base
|
||||
- name: Set TGS4_GITHUB_REF for PR
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
run: echo "::set-env name=TGS4_TEST_BRANCH::${{ github.event.base_ref.substring('refs/heads/'.length - 1) }}"
|
||||
run: echo "::set-env name=TGS4_GITHUB_REF::${{ github.event.base_ref }}"
|
||||
|
||||
- name: Set TGS4_TEST_BRANCH to pushed branch
|
||||
- name: Set TGS4_GITHUB_REF for push
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
run: echo "::set-env name=TGS4_TEST_BRANCH::${{ github.event.ref.substring('refs/heads/'.length - 1) }}"
|
||||
run: echo "::set-env name=TGS4_GITHUB_REF::${{ github.event.ref }}"
|
||||
|
||||
- name: Run Integration Test
|
||||
run: |
|
||||
|
||||
@@ -22,11 +22,13 @@ namespace Tgstation.Server.Tests.Instance
|
||||
|
||||
public async Task RunPreWatchdog(CancellationToken cancellationToken)
|
||||
{
|
||||
const string GitHubRef = "TGS4_GITHUB_REF";
|
||||
var branchSourceEnvVars = new List<string>
|
||||
{
|
||||
"TGS4_TEST_BRANCH",
|
||||
"APPVEYOR_REPO_BRANCH",
|
||||
"TRAVIS_BRANCH"
|
||||
"TRAVIS_BRANCH",
|
||||
GitHubRef
|
||||
};
|
||||
|
||||
string workingBranch = null;
|
||||
@@ -35,6 +37,9 @@ namespace Tgstation.Server.Tests.Instance
|
||||
var envVar = Environment.GetEnvironmentVariable(envVarName);
|
||||
if (!String.IsNullOrWhiteSpace(envVar))
|
||||
{
|
||||
if(envVarName == GitHubRef)
|
||||
envVar = envVar.Substring("refs/heads/".Length);
|
||||
|
||||
workingBranch = envVar;
|
||||
Console.WriteLine($"TEST: Set working branch to '{workingBranch}' from env var '{envVarName}'");
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user