Skip to content

Commit 777ce19

Browse files
Merge branch 'main' into devon4ng-lazy-loading
2 parents 438b559 + fc08618 commit 777ce19

4 files changed

Lines changed: 45 additions & 20 deletions

File tree

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
name: Check PR Katacoda Syntax
2-
2+
env:
3+
PR_NUMBER: ${{github.event.number}}
34
on:
45
pull_request_target:
56
branches: [ main ]
67
jobs:
78
setup-matrix:
89
runs-on: ubuntu-latest
9-
env:
10-
PR_NUMBER: ${{github.event.number}}
1110

1211
steps:
1312
- name: Checkout playbooks
@@ -18,8 +17,10 @@ jobs:
1817
run: npm install
1918
- name: Select Changed Files
2019
id: changedfiles
21-
run: |
22-
node selectChangedFiles.js
20+
run: node selectChangedFiles.js
21+
- name: Get Playbook Checkout
22+
id: get_checkout
23+
run: node getPlaybookCheckout.js
2324
- name: Setup matrix combinations
2425
id: setup-matrix-combinations
2526
run: |
@@ -34,6 +35,8 @@ jobs:
3435
echo ::set-output name=matrix-combinations::{\"include\":[$MATRIX_PARAMS_COMBINATIONS]}
3536
outputs:
3637
matrix-combinations: ${{ steps.setup-matrix-combinations.outputs.matrix-combinations }}
38+
checkout_ref: ${{ steps.get_branch.outputs.ref}}
39+
checkout_name: ${{ steps.get_branch.outputs.name}}
3740

3841
build:
3942
runs-on: ubuntu-latest
@@ -45,31 +48,24 @@ jobs:
4548
uses: actions/checkout@v2
4649
with:
4750
repository: devonfw-tutorials/tutorial-compiler
48-
4951
- name: Checkout playbooks
5052
uses: actions/checkout@v2
5153
with:
52-
repository: devonfw-tutorials/tutorials
54+
repository: ${{needs.setup-matrix.output.checkout_name}}/tutorials
55+
ref: ${{needs.setup-matrix.outputs.checkout_ref}}
5356
path: playbooks
54-
5557
- uses: actions/setup-node@v2-beta
56-
5758
- name: install TS
5859
run: npm install typescript
59-
6060
- name: npm install
6161
run: npm install
62-
63-
- name: run buildRun.sh --user ${{ github.actor }} --branch ${{ github.event.pull_request_target.head.ref }} --checkSyntax
64-
run: |
65-
sh buildRun.sh --user ${{ github.actor }} --branch ${{ github.event.pull_request_target.head.ref }} --checkSyntax -p ${{ matrix.tutorial }} -e test_console
66-
62+
- name: run buildRun.sh --user ${{ github.actor }} --branch ${{needs.setup-matrix.outputs.head_ref}} --checkSyntax
63+
run: sh buildRun.sh --user ${{ github.actor }} --branch ${{needs.setup-matrix.outputs.head_ref}} --checkSyntax -p ${{ matrix.tutorial }} -e test_console
6764
- name: Check error file existence
6865
id: check_files
6966
uses: andstor/file-existence-action@v1
7067
with:
7168
files: "./build/errors/syntaxErrors.md"
72-
7369
- name: Get message
7470
id: get_message
7571
if: steps.check_files.outputs.files_exists == 'true'
@@ -80,11 +76,10 @@ jobs:
8076
message="${message//$'\r'/'%0D'}"
8177
echo "${message}"
8278
echo "::set-output name=message::$message"
83-
8479
- name: Request changes
8580
if: ${{ steps.get_message.outputs.message != '' }}
8681
uses: andrewmusgrave/automatic-pull-request-review@0.0.2
8782
with:
8883
repo-token: '${{ secrets.GITHUB_TOKEN }}'
8984
event: COMMENT
90-
body: ${{ steps.get_message.outputs.message }}
85+
body: ${{ steps.get_message.outputs.message }}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
The applciation you see here is a clone of devon4ng-application-template. You can find it here [here](https://github.com/devonfw/devon4ng-application-template)
1+
The application you see here is a clone of devon4ng-application-template. You can find it [here](https://github.com/devonfw/devon4ng-application-template)
22

3-
The `SampleDataModule` is a nice exmple of the different layers explained. It holds some components (representing the *components* layer) and also has a `SampleDataService` (representing the *service* layer) which is imported in the required components.
3+
The `SampleDataModule` is a nice example of the different layers explained. It holds some components (representing the *components* layer) and also has a `SampleDataService` (representing the *service* layer) which is imported in the required components.
44

55
The service acts as the adapter element explained earlier (used to make XHR calls).

devon4ng-architecture/index.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,6 @@ To conclude, in this tutorial you learned
6868
* the different types of modules - core, shared and feature
6969
7070
Then we referred a devon4ng application by cloning it and traversing through its files. You can study in more detail about Angular architecture by following [this document](https://devonfw.com/website/pages/docs/master-devon4ng.asciidoc_architecture.html#meta-architecture.asciidoc_devonfw-reference-client-architecture).
71+
72+
The idea with devon4ng is to define an architecture which is a compromise between, on the one hand, leveraging the best practices and latest trends like reactive style development, on the other hand, providing a short onboarding time while still using an architecture that helps us scale and be productive at the same time.
7173
====

getPlaybookCheckout.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
const core = require("@actions/core");
2+
const { Octokit } = require("@octokit/core");
3+
const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN });
4+
5+
async function getPlaybookCheckout() {
6+
let pr = process.env.PR_NUMBER;
7+
let ref ="";
8+
try {
9+
let get = await octokit.request('GET /repos/{owner}/{repo}/pulls/{pull_number}', {
10+
owner: 'devonfw-tutorials',
11+
repo: 'tutorials',
12+
pull_number: pr
13+
});
14+
head = get.data.head;
15+
} catch(e) {
16+
throw e;
17+
}
18+
core.info(`ref: ${head.ref}`);
19+
core.setOutput('ref', head.ref);
20+
core.info(`name : ${head.ref}`);
21+
core.setOutput('name', head.ref);
22+
}
23+
24+
getPlaybookCheckout().catch(err => {
25+
console.log(err);
26+
process.exit(1);
27+
});
28+

0 commit comments

Comments
 (0)