|
2 | 2 |
|
3 | 3 | ## 1. Setting up a Test Job |
4 | 4 |
|
5 | | -- Clone [automation lecture repository](https://github.com/Simulation-Software-Engineering/automation-lecture-wt2425) and run code and tests |
| 5 | +- Clone [automation lecture repository](https://github.com/Simulation-Software-Engineering/automation-lecture) and run code and tests |
6 | 6 | - Set up workflow file |
7 | 7 |
|
8 | 8 | ```bash |
|
23 | 23 | test: |
24 | 24 | runs-on: ubuntu-latest |
25 | 25 | steps: |
26 | | - - uses: actions/checkout@v2 |
27 | | - - uses: actions/setup-python@v2 |
| 26 | + - uses: actions/checkout@v6 |
| 27 | + - uses: actions/setup-python@v6 |
28 | 28 | with: |
29 | | - python-version: '3.8' |
| 29 | + python-version: '3.10' |
30 | 30 | - name: "Run unittest" |
31 | 31 | run: python -m unittest |
32 | 32 | ``` |
|
70 | 70 | style: |
71 | 71 | runs-on: ubuntu-latest |
72 | 72 | steps: |
73 | | - - uses: actions/checkout@v2 |
74 | | - - uses: actions/setup-python@v2 |
| 73 | + - uses: actions/checkout@v6 |
| 74 | + - uses: actions/setup-python@v6 |
75 | 75 | with: |
76 | | - python-version: '3.8' |
| 76 | + python-version: '3.10' |
77 | 77 | - name: "Install style checker" |
78 | 78 | run: pip install black |
79 | 79 | - name: "Run style check" |
|
87 | 87 | - name: "Run build phase" |
88 | 88 | run: echo "Building project $PROJECT_NAME" |
89 | 89 | test: |
90 | | - needs: build |
| 90 | + # needs: build |
91 | 91 | runs-on: ubuntu-latest |
92 | 92 | steps: |
93 | | - - uses: actions/checkout@v2 |
94 | | - - uses: actions/setup-python@v2 |
| 93 | + - uses: actions/checkout@v6 |
| 94 | + - uses: actions/setup-python@v6 |
95 | 95 | with: |
96 | | - python-version: '3.8' |
| 96 | + python-version: '3.10' |
97 | 97 | - name: "Run unittest" |
98 | 98 | run: python -m unittest |
99 | 99 | ``` |
100 | 100 |
|
101 | | -- We need to run `actions/checkout@v2` in each job |
| 101 | +- We need to run `actions/checkout` in each job |
102 | 102 | - We could share the repository between jobs via artifacts, but that is uncommon. |
103 | | -- We need to run `actions/setup-python@v2` since jobs do not share the environment. |
| 103 | +- We need to run `actions/setup-python` since jobs do not share the environment. |
104 | 104 | - We specify dependencies by `needs` such that the steps run after each other. |
105 | 105 | - We do not have a real build step since it is Python. However, this might be interesting for compiled code. |
106 | 106 |
|
|
0 commit comments