Skip to content

Commit

Permalink
Merge pull request #32172 from staszekscp/update-java-for-github-actions
Browse files Browse the repository at this point in the history
[NoQA] [GH Actions] Update java for GitHub Actions
  • Loading branch information
mountiny authored Nov 29, 2023
2 parents 609c336 + 527f01c commit 5eb3fa2
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/platformDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ jobs:
- name: Setup Node
uses: ./.github/actions/composite/setupNode

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'oracle'
java-version: '17'

- name: Setup Ruby
uses: ruby/setup-ruby@a05e47355e80e57b9a67566a813648fa67d92011
with:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/testBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ jobs:
- name: Setup Node
uses: ./.github/actions/composite/setupNode

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'oracle'
java-version: '17'

- name: Setup Ruby
uses: ruby/setup-ruby@a05e47355e80e57b9a67566a813648fa67d92011
with:
Expand Down
12 changes: 12 additions & 0 deletions workflow_tests/assertions/platformDeployAssertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ const assertAndroidJobExecuted = (workflowResult, didExecute = true, isProductio
utils.createStepAssertion('Checkout', true, null, 'ANDROID', 'Checking out'),
utils.createStepAssertion('Configure MapBox SDK', true, null, 'ANDROID', 'Configure MapBox SDK'),
utils.createStepAssertion('Setup Node', true, null, 'ANDROID', 'Setting up Node'),
utils.createStepAssertion(
'Setup Java',
true,
null,
'ANDROID',
'Setup Java',
[
{key: 'distribution', value: 'oracle'},
{key: 'java-version', value: '17'},
],
[],
),
utils.createStepAssertion('Setup Ruby', true, null, 'ANDROID', 'Setting up Ruby', [
{key: 'ruby-version', value: '2.7'},
{key: 'bundler-cache', value: 'true'},
Expand Down
12 changes: 12 additions & 0 deletions workflow_tests/assertions/testBuildAssertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ const assertAndroidJobExecuted = (workflowResult, ref = '', didExecute = true, f
[],
),
utils.createStepAssertion('Setup Node', true, null, 'ANDROID', 'Setup Node', [], []),
utils.createStepAssertion(
'Setup Java',
true,
null,
'ANDROID',
'Setup Java',
[
{key: 'distribution', value: 'oracle'},
{key: 'java-version', value: '17'},
],
[],
),
utils.createStepAssertion(
'Setup Ruby',
true,
Expand Down
2 changes: 2 additions & 0 deletions workflow_tests/mocks/platformDeployMocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const PLATFORM_DEPLOY__DEPLOY_CHECKLIST__STEP_MOCKS = [PLATFORM_DEPLOY__DEPLOY_C
const PLATFORM_DEPLOY__ANDROID__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checking out', 'ANDROID');
const PLATFORM_DEPLOY__ANDROID__CONFIGURE_MAPBOX_SDK__STEP_MOCK = utils.createMockStep('Configure MapBox SDK', 'Configure MapBox SDK', 'ANDROID');
const PLATFORM_DEPLOY__ANDROID__SETUP_NODE__STEP_MOCK = utils.createMockStep('Setup Node', 'Setting up Node', 'ANDROID');
const PLATFORM_DEPLOY__ANDROID__SETUP_JAVA__STEP_MOCK = utils.createMockStep('Setup Java', 'Setup Java', 'ANDROID', ['distribution', 'java-version'], []);
const PLATFORM_DEPLOY__ANDROID__SETUP_RUBY__STEP_MOCK = utils.createMockStep('Setup Ruby', 'Setting up Ruby', 'ANDROID', ['ruby-version', 'bundler-cache']);
const PLATFORM_DEPLOY__ANDROID__DECRYPT_KEYSTORE__STEP_MOCK = utils.createMockStep('Decrypt keystore', 'Decrypting keystore', 'ANDROID', null, ['LARGE_SECRET_PASSPHRASE']);
const PLATFORM_DEPLOY__ANDROID__DECRYPT_JSON_KEY__STEP_MOCK = utils.createMockStep('Decrypt json key', 'Decrypting JSON key', 'ANDROID', null, ['LARGE_SECRET_PASSPHRASE']);
Expand Down Expand Up @@ -62,6 +63,7 @@ const PLATFORM_DEPLOY__ANDROID__STEP_MOCKS = [
PLATFORM_DEPLOY__ANDROID__CHECKOUT__STEP_MOCK,
PLATFORM_DEPLOY__ANDROID__CONFIGURE_MAPBOX_SDK__STEP_MOCK,
PLATFORM_DEPLOY__ANDROID__SETUP_NODE__STEP_MOCK,
PLATFORM_DEPLOY__ANDROID__SETUP_JAVA__STEP_MOCK,
PLATFORM_DEPLOY__ANDROID__SETUP_RUBY__STEP_MOCK,
PLATFORM_DEPLOY__ANDROID__DECRYPT_KEYSTORE__STEP_MOCK,
PLATFORM_DEPLOY__ANDROID__DECRYPT_JSON_KEY__STEP_MOCK,
Expand Down
2 changes: 2 additions & 0 deletions workflow_tests/mocks/testBuildMocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const TESTBUILD__ANDROID__CREATE_ENV_ADHOC__STEP_MOCK = utils.createMockStep(
[],
);
const TESTBUILD__ANDROID__SETUP_NODE__STEP_MOCK = utils.createMockStep('Setup Node', 'Setup Node', 'ANDROID', [], []);
const TESTBUILD__ANDROID__SETUP_JAVA__STEP_MOCK = utils.createMockStep('Setup Java', 'Setup Java', 'ANDROID', ['distribution', 'java-version'], []);
const TESTBUILD__ANDROID__SETUP_RUBY__STEP_MOCK = utils.createMockStep('Setup Ruby', 'Setup Ruby', 'ANDROID', ['ruby-version', 'bundler-cache'], []);
const TESTBUILD__ANDROID__DECRYPT_KEYSTORE__STEP_MOCK = utils.createMockStep('Decrypt keystore', 'Decrypt keystore', 'ANDROID', [], ['LARGE_SECRET_PASSPHRASE']);
const TESTBUILD__ANDROID__DECRYPT_JSON_KEY__STEP_MOCK = utils.createMockStep('Decrypt json key', 'Decrypt json key', 'ANDROID', [], ['LARGE_SECRET_PASSPHRASE']);
Expand All @@ -85,6 +86,7 @@ const TESTBUILD__ANDROID__STEP_MOCKS = [
TESTBUILD__ANDROID__CHECKOUT__STEP_MOCK,
TESTBUILD__ANDROID__CREATE_ENV_ADHOC__STEP_MOCK,
TESTBUILD__ANDROID__SETUP_NODE__STEP_MOCK,
TESTBUILD__ANDROID__SETUP_JAVA__STEP_MOCK,
TESTBUILD__ANDROID__SETUP_RUBY__STEP_MOCK,
TESTBUILD__ANDROID__DECRYPT_KEYSTORE__STEP_MOCK,
TESTBUILD__ANDROID__DECRYPT_JSON_KEY__STEP_MOCK,
Expand Down
4 changes: 2 additions & 2 deletions workflow_tests/testBuild.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ describe('test workflow testBuild', () => {
web: mocks.TESTBUILD__WEB__STEP_MOCKS,
postGithubComment: mocks.TESTBUILD__POSTGITHUBCOMMENT__STEP_MOCKS,
};
testMockSteps.android[4] = utils.createMockStep('Decrypt keystore', 'Decrypt keystore', 'ANDROID', [], ['LARGE_SECRET_PASSPHRASE'], {}, {}, false);
testMockSteps.android[5] = utils.createMockStep('Decrypt keystore', 'Decrypt keystore', 'ANDROID', [], ['LARGE_SECRET_PASSPHRASE'], {}, {}, false);
const result = await act.runEvent(event, {
workflowFile: path.join(repoPath, '.github', 'workflows', 'testBuild.yml'),
mockSteps: testMockSteps,
Expand All @@ -211,7 +211,7 @@ describe('test workflow testBuild', () => {

assertions.assertValidateActorJobExecuted(result, '1234');
assertions.assertGetBranchRefJobExecuted(result);
assertions.assertAndroidJobExecuted(result, 'test-ref', true, 4);
assertions.assertAndroidJobExecuted(result, 'test-ref', true, 5);
assertions.assertIOSJobExecuted(result, 'test-ref');
assertions.assertDesktopJobExecuted(result, 'test-ref');
assertions.assertWebJobExecuted(result, 'test-ref');
Expand Down

0 comments on commit 5eb3fa2

Please sign in to comment.