Skip to content

Commit abb60c1

Browse files
committed
Add ActionServerless action
1 parent 6e96bc3 commit abb60c1

File tree

6 files changed

+35
-0
lines changed

6 files changed

+35
-0
lines changed

.github/workflows/run_examples.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Run examples
2+
3+
on: [push]
4+
5+
jobs:
6+
test_run_examples:
7+
runs-on: ubuntu-latest
8+
name: A job to run examples
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
- name: Clear result files ahead
13+
run: rm -rf output/
14+
- name: Run examples
15+
uses: gitx-io/ActionServerless@master
16+
with:
17+
filepath: ./01_Day_Introduction ./02_Day_Variables_builtin_functions ./03_Day_Operators ./04_Day_Strings ./05_Day_Lists
18+
- name: Git commit
19+
run: |
20+
# git commit if there's any change
21+
if test -n "$(git status --porcelain 2>/dev/null)"; then
22+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
23+
git config --local user.name "github-actions[bot]"
24+
git add .
25+
git commit -m "Add changes"
26+
git push origin ${GITHUB_REF##*/}
27+
fi

01_Day_Introduction/helloworld.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# GET /output/01_Day_Introduction/helloworld
2+
13
# Introduction
24
# Day 1 - 30DaysOfPython Challenge
35

02_Day_Variables_builtin_functions/variables.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# GET /output/02_Day_Variables_builtin_functions/variables
12

23
# Variables in Python
34

03_Day_Operators/day-3.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# GET /output/03_Day_Operators/day-3
2+
13
# Arithmetic Operations in Python
24
# Integers
35

04_Day_Strings/day_4.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# GET /output/04_Day_Strings/day_4
12

23
# Single line comment
34
letter = 'P' # A string could be a single character or a bunch of texts

05_Day_Lists/day_5.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# GET /output/05_Day_Lists/day_5
2+
13
empty_list = list() # this is an empty list, no item in the list
24
print(len(empty_list)) # 0
35

0 commit comments

Comments
 (0)