From 8d9cd2c13faa78f5cd0a5d35ee5472dca893042d Mon Sep 17 00:00:00 2001 From: mazen423 Date: Tue, 22 Dec 2020 17:09:19 +0100 Subject: [PATCH 01/10] env --- .github/workflows/env.yaml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/env.yaml diff --git a/.github/workflows/env.yaml b/.github/workflows/env.yaml new file mode 100644 index 0000000..aa63ae1 --- /dev/null +++ b/.github/workflows/env.yaml @@ -0,0 +1,30 @@ +name: env virables workflow +on : push +env: + WF_ENV : Available to all jobs +jobs: + log-env: + runs-on: ubuntu-latest + env : + JOB_ENV : Availabe in log env job + steps: + - name : Log env variables + env: + STEP_ENV : Available only in step + run: | + echo "WF_ENV:${WF_ENV}" + echo "JOB_ENV:${JOB_ENV}" + echo "STEP_ENV:${STEP_ENV}" + - name : log 2 step + run : | + echo "WF_ENV:${WF_ENV}" + echo "JOB_ENV:${JOB_ENV}" + echo "STEP_ENV:${STEP_ENV}" + log2-env: + runs-on : ubuntu + steps: + - name: test access envs + run : | + echo "WF_ENV:${WF_ENV}" + echo "JOB_ENV:${JOB_ENV}" + echo "STEP_ENV:${STEP_ENV}" From a2b100fb323c52f6780cafdd3ad3437887de94b5 Mon Sep 17 00:00:00 2001 From: mazen423 Date: Tue, 22 Dec 2020 17:12:23 +0100 Subject: [PATCH 02/10] env --- .github/workflows/env.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/env.yaml b/.github/workflows/env.yaml index aa63ae1..111fdb7 100644 --- a/.github/workflows/env.yaml +++ b/.github/workflows/env.yaml @@ -21,7 +21,7 @@ jobs: echo "JOB_ENV:${JOB_ENV}" echo "STEP_ENV:${STEP_ENV}" log2-env: - runs-on : ubuntu + runs-on : ubuntu-latest steps: - name: test access envs run : | From d47da287fb91f8634885a266877b841404cb82e7 Mon Sep 17 00:00:00 2001 From: mazen423 Date: Wed, 23 Dec 2020 10:55:00 +0100 Subject: [PATCH 03/10] node version --- .github/workflows/matrix.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/matrix.yaml diff --git a/.github/workflows/matrix.yaml b/.github/workflows/matrix.yaml new file mode 100644 index 0000000..fbae283 --- /dev/null +++ b/.github/workflows/matrix.yaml @@ -0,0 +1,14 @@ +name : matrix workflow +on : [push] +jobs: + node-version: + runs-on : ubuntu-latest + steps : + - name: node version original + run : node -v + - name : changing node version + uses : actions/setup-node@v2 + with : + node-version: '12' + - name: node version after modification + run : node -v \ No newline at end of file From c7ce04b8e6c9bd1996b5b2f3a6bd9d93279a08f6 Mon Sep 17 00:00:00 2001 From: mazen423 Date: Wed, 23 Dec 2020 11:15:29 +0100 Subject: [PATCH 04/10] matrix --- .github/workflows/matrix.yaml | 8 ++++++-- {.github/workflows => all-work-flows}/actions.yaml | 0 {.github/workflows => all-work-flows}/env.yaml | 0 {.github/workflows => all-work-flows}/simple.yaml | 0 4 files changed, 6 insertions(+), 2 deletions(-) rename {.github/workflows => all-work-flows}/actions.yaml (100%) rename {.github/workflows => all-work-flows}/env.yaml (100%) rename {.github/workflows => all-work-flows}/simple.yaml (100%) diff --git a/.github/workflows/matrix.yaml b/.github/workflows/matrix.yaml index fbae283..e1e5f25 100644 --- a/.github/workflows/matrix.yaml +++ b/.github/workflows/matrix.yaml @@ -2,13 +2,17 @@ name : matrix workflow on : [push] jobs: node-version: - runs-on : ubuntu-latest + strategy: + matrix: + node_version: [6,7] + os_type: [ubuntu-latest, windows-latest] + runs-on : ${{matrix.os_type}} steps : - name: node version original run : node -v - name : changing node version uses : actions/setup-node@v2 with : - node-version: '12' + node-version: ${{matrix.node_version}} - name: node version after modification run : node -v \ No newline at end of file diff --git a/.github/workflows/actions.yaml b/all-work-flows/actions.yaml similarity index 100% rename from .github/workflows/actions.yaml rename to all-work-flows/actions.yaml diff --git a/.github/workflows/env.yaml b/all-work-flows/env.yaml similarity index 100% rename from .github/workflows/env.yaml rename to all-work-flows/env.yaml diff --git a/.github/workflows/simple.yaml b/all-work-flows/simple.yaml similarity index 100% rename from .github/workflows/simple.yaml rename to all-work-flows/simple.yaml From b3d11fae703da1d4cceef74a38a461f539559d83 Mon Sep 17 00:00:00 2001 From: mazen423 Date: Wed, 23 Dec 2020 11:20:54 +0100 Subject: [PATCH 05/10] Matrix_exclude --- .github/workflows/matrix.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/matrix.yaml b/.github/workflows/matrix.yaml index e1e5f25..7c89ca7 100644 --- a/.github/workflows/matrix.yaml +++ b/.github/workflows/matrix.yaml @@ -4,8 +4,14 @@ jobs: node-version: strategy: matrix: - node_version: [6,7] + node_version: [6,7,8] os_type: [ubuntu-latest, windows-latest] + exclude: + - os_type: ubuntu-latest + node_version: 6 + - os_type: windows-latest + node_version: 8 + runs-on : ${{matrix.os_type}} steps : - name: node version original From 37836e83e111154bd33ac0e6e467f4497398f4ae Mon Sep 17 00:00:00 2001 From: mazen423 Date: Wed, 23 Dec 2020 11:27:51 +0100 Subject: [PATCH 06/10] Matrix_include --- .github/workflows/matrix.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/matrix.yaml b/.github/workflows/matrix.yaml index 7c89ca7..ae7f2d9 100644 --- a/.github/workflows/matrix.yaml +++ b/.github/workflows/matrix.yaml @@ -11,8 +11,14 @@ jobs: node_version: 6 - os_type: windows-latest node_version: 8 + include: + - os_type : ubuntu-latest + node_version: 7 + is_ubuntu: "true" runs-on : ${{matrix.os_type}} + env: + IS_UBUNTU_7: ${{matrix.is_ubuntu}} steps : - name: node version original run : node -v @@ -21,4 +27,6 @@ jobs: with : node-version: ${{matrix.node_version}} - name: node version after modification - run : node -v \ No newline at end of file + run : | + node -v + echo "IS_UBUNTU_7:$IS_UBUNTU_7 From 9a01d4781c51f66ff7c9d3e1c88aa33d26d82531 Mon Sep 17 00:00:00 2001 From: mazen423 Date: Wed, 23 Dec 2020 11:29:33 +0100 Subject: [PATCH 07/10] Matrix_include --- .github/workflows/matrix.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/matrix.yaml b/.github/workflows/matrix.yaml index ae7f2d9..4209a65 100644 --- a/.github/workflows/matrix.yaml +++ b/.github/workflows/matrix.yaml @@ -29,4 +29,4 @@ jobs: - name: node version after modification run : | node -v - echo "IS_UBUNTU_7:$IS_UBUNTU_7 + echo "IS_UBUNTU_7:"$IS_UBUNTU_7 From 55cc803119a0fda3101a3f5fb0e91cde1c9c5e70 Mon Sep 17 00:00:00 2001 From: mazen423 Date: Wed, 23 Dec 2020 11:43:48 +0100 Subject: [PATCH 08/10] container --- .github/workflows/container.yaml | 12 ++++++++++++ .github/workflows/matrix.yaml | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/container.yaml diff --git a/.github/workflows/container.yaml b/.github/workflows/container.yaml new file mode 100644 index 0000000..9d3b978 --- /dev/null +++ b/.github/workflows/container.yaml @@ -0,0 +1,12 @@ +name : run docker container in work flow +on : [push] +jobs: + node-docker: + runs-on: ubuntu-latest + container: + image: node:13.5.0-alpine3.10 + steps: + - name : log node version + run : | + node -v + cat /etc/os-release \ No newline at end of file diff --git a/.github/workflows/matrix.yaml b/.github/workflows/matrix.yaml index 4209a65..873badc 100644 --- a/.github/workflows/matrix.yaml +++ b/.github/workflows/matrix.yaml @@ -1,5 +1,5 @@ name : matrix workflow -on : [push] +on : [pull_request] jobs: node-version: strategy: From 082a5387fc2f90051416ceaa9a920d0929a88dde Mon Sep 17 00:00:00 2001 From: mazen423 Date: Wed, 23 Dec 2020 12:24:45 +0100 Subject: [PATCH 09/10] work --- {all-work-flows => .github/workflows}/simple.yaml | 7 ++++++- {.github/workflows => all-work-flows}/container.yaml | 1 + {.github/workflows => all-work-flows}/matrix.yaml | 0 3 files changed, 7 insertions(+), 1 deletion(-) rename {all-work-flows => .github/workflows}/simple.yaml (83%) rename {.github/workflows => all-work-flows}/container.yaml (74%) rename {.github/workflows => all-work-flows}/matrix.yaml (100%) diff --git a/all-work-flows/simple.yaml b/.github/workflows/simple.yaml similarity index 83% rename from all-work-flows/simple.yaml rename to .github/workflows/simple.yaml index d2b2222..e1fe22b 100644 --- a/all-work-flows/simple.yaml +++ b/.github/workflows/simple.yaml @@ -1,8 +1,12 @@ name: shell commands -on : [push] +on : [pull_request] + jobs: run-shell-command: + runs-on: ubuntu-latest + env: + working : ${{ github.base_ref }} steps: - name: echo string run : echo "hello world" @@ -10,6 +14,7 @@ jobs: run : | node -v npm -v + echo $working - name : python command run : | import platform diff --git a/.github/workflows/container.yaml b/all-work-flows/container.yaml similarity index 74% rename from .github/workflows/container.yaml rename to all-work-flows/container.yaml index 9d3b978..736d4b0 100644 --- a/.github/workflows/container.yaml +++ b/all-work-flows/container.yaml @@ -1,4 +1,5 @@ name : run docker container in work flow +#here all our steps of the job will run in container instead of VM directly on : [push] jobs: node-docker: diff --git a/.github/workflows/matrix.yaml b/all-work-flows/matrix.yaml similarity index 100% rename from .github/workflows/matrix.yaml rename to all-work-flows/matrix.yaml From 35ab01d0b3c509f56b47926518cd4046b1a2cd5b Mon Sep 17 00:00:00 2001 From: mazen423 Date: Wed, 23 Dec 2020 12:25:50 +0100 Subject: [PATCH 10/10] test --- test | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test diff --git a/test b/test new file mode 100644 index 0000000..e69de29