Skip to content

Commit fe351fc

Browse files
committed
testing github actions
1 parent 713b722 commit fe351fc

1 file changed

Lines changed: 74 additions & 0 deletions

File tree

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Testing Github Actions Workflow
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
test:
7+
name: Testing Github Actions Job
8+
env:
9+
# CHOSEN_ENVIRONMENT: ${{ jobs.test.environment.url }}
10+
FOO: ${{ secrets.FOO }}
11+
BAR: ${{ secrets.BAR }}
12+
environment: env1
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: check_env_vars
18+
run: |
19+
echo "env.FOO == ${{ env.FOO }}"
20+
echo "env.BAR == ${{ env.BAR }}"
21+
# echo "env.CHOSEN_ENVIRONMENT == ${{ env.CHOSEN_ENVIRONMENT }}"
22+
23+
- name: this_should_run
24+
id: run
25+
if: ${{ env.FOO == 'foo1' }}
26+
run: echo "env.FOO == 'foo1' -> ${{ env.FOO }} -> ${{ env.FOO == 'foo1' }} -> you will see this"
27+
28+
- name: test_conditional
29+
run: |
30+
echo "Result is ${{ (steps.run.outcome == 'success' && 'hola') || 'chao' }}" \
31+
&& echo "Previous step ${{ steps.run.outcome }}"
32+
33+
- name: this_should_not_run
34+
if: ${{ env.FOO == 'foo2' }}
35+
run: echo "env.FOO == 'foo2' -> ${{ env.FOO }} -> ${{ env.FOO == 'foo2' }} -> you will not see this"
36+
37+
- name: this_fails
38+
continue-on-error: true
39+
id: fails
40+
run: exit 1
41+
42+
- name: test_conditional_2
43+
run: echo "Result is ${{ (steps.fails.outcome == 'success' && 'hola') || 'chao' }}"
44+
45+
# - name: Dump GitHub context
46+
# env:
47+
# GITHUB_CONTEXT: ${{ toJson(github) }}
48+
# run: echo "$GITHUB_CONTEXT"
49+
50+
# - name: Dump job context
51+
# env:
52+
# JOB_CONTEXT: ${{ toJson(job) }}
53+
# run: echo "$JOB_CONTEXT"
54+
55+
- name: Dump steps context
56+
env:
57+
STEPS_CONTEXT: ${{ toJson(steps) }}
58+
run: echo "$STEPS_CONTEXT"
59+
60+
# - name: Dump runner context
61+
# env:
62+
# RUNNER_CONTEXT: ${{ toJson(runner) }}
63+
# run: echo "$RUNNER_CONTEXT"
64+
65+
# - name: Dump strategy context
66+
# env:
67+
# STRATEGY_CONTEXT: ${{ toJson(strategy) }}
68+
# run: echo "$STRATEGY_CONTEXT"
69+
70+
# - name: Dump matrix context
71+
# env:
72+
# MATRIX_CONTEXT: ${{ toJson(matrix) }}
73+
# run: echo "$MATRIX_CONTEXT"
74+

0 commit comments

Comments
 (0)