diff --git a/.github/workflows/simple.yaml b/.github/workflows/simple.yaml index d2b2222..e1fe22b 100644 --- a/.github/workflows/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/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/all-work-flows/container.yaml b/all-work-flows/container.yaml new file mode 100644 index 0000000..736d4b0 --- /dev/null +++ b/all-work-flows/container.yaml @@ -0,0 +1,13 @@ +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: + 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/all-work-flows/env.yaml b/all-work-flows/env.yaml new file mode 100644 index 0000000..111fdb7 --- /dev/null +++ b/all-work-flows/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-latest + steps: + - name: test access envs + run : | + echo "WF_ENV:${WF_ENV}" + echo "JOB_ENV:${JOB_ENV}" + echo "STEP_ENV:${STEP_ENV}" diff --git a/all-work-flows/matrix.yaml b/all-work-flows/matrix.yaml new file mode 100644 index 0000000..873badc --- /dev/null +++ b/all-work-flows/matrix.yaml @@ -0,0 +1,32 @@ +name : matrix workflow +on : [pull_request] +jobs: + node-version: + strategy: + matrix: + 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 + 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 + - name : changing node version + uses : actions/setup-node@v2 + with : + node-version: ${{matrix.node_version}} + - name: node version after modification + run : | + node -v + echo "IS_UBUNTU_7:"$IS_UBUNTU_7 diff --git a/test b/test new file mode 100644 index 0000000..e69de29