Skip to content

Commit 9236faa

Browse files
authored
Update: [CI] switch to reusing workflows and update actions the latest (#24)
1 parent 2842d7c commit 9236faa

File tree

2 files changed

+37
-48
lines changed

2 files changed

+37
-48
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,12 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414
with:
1515
fetch-depth: 0
1616

17-
- name: Checkout tags
18-
uses: openttd/actions/checkout@v1
19-
with:
20-
with-tags: true
21-
2217
- name: Set up Python
23-
uses: actions/setup-python@v1
18+
uses: actions/setup-python@v4
2419
with:
2520
python-version: '3.8'
2621

.github/workflows/testing.yml

Lines changed: 35 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,83 +8,77 @@ on:
88
branches:
99
- main
1010

11+
concurrency:
12+
group: testing-${{ github.ref }}
13+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
14+
1115
jobs:
1216
codeql:
1317
name: Security and Quality
1418
runs-on: ubuntu-latest
19+
1520
steps:
1621
- name: Checkout
17-
uses: actions/checkout@v2
18-
- name: Set up Python 3.8
19-
uses: actions/setup-python@v1
22+
uses: actions/checkout@v3
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v4
2026
with:
2127
python-version: 3.8
28+
2229
- name: Install dependencies
2330
run: python -m pip install -e .
31+
2432
- name: Initialize CodeQL
25-
uses: github/codeql-action/init@v1
33+
uses: github/codeql-action/init@v2
2634
with:
2735
languages: python
2836
queries: security-and-quality
37+
source-root: .
38+
2939
- name: Perform CodeQL Analysis
30-
uses: github/codeql-action/analyze@v1
40+
uses: github/codeql-action/analyze@v2
3141

3242
flake8:
3343
name: Flake8
34-
runs-on: ubuntu-latest
35-
steps:
36-
- name: Checkout
37-
uses: actions/checkout@v2
38-
- name: Flake8
39-
uses: TrueBrain/actions-flake8@v2
40-
with:
41-
path: openttd_protocol
44+
uses: OpenTTD/actions/.github/workflows/rw-py-flake8.yml@v4
45+
with:
46+
python-path: openttd_protocol
4247

4348
black:
4449
name: Black
45-
runs-on: ubuntu-latest
46-
steps:
47-
- name: Checkout
48-
uses: actions/checkout@v2
49-
- name: Set up Python 3.8
50-
uses: actions/setup-python@v1
51-
with:
52-
python-version: 3.8
53-
- name: Set up packages
54-
run: |
55-
python -m pip install --upgrade pip
56-
pip install black
57-
- name: Black
58-
run: |
59-
black -l 120 --check openttd_protocol
50+
uses: OpenTTD/actions/.github/workflows/rw-py-black.yml@v4
51+
with:
52+
python-version: 3.8
53+
python-path: openttd_protocol
6054

6155
pytest:
6256
name: pytest
6357
runs-on: ubuntu-latest
58+
6459
steps:
6560
- name: Checkout
66-
uses: actions/checkout@v2
61+
uses: actions/checkout@v3
62+
6763
- name: Set up Python 3.8
68-
uses: actions/setup-python@v1
64+
uses: actions/setup-python@v4
6965
with:
7066
python-version: 3.8
67+
7168
- name: Install pytest
72-
run: python -m pip install -r requirements.test
69+
run: |
70+
python -m pip install -r requirements.test
71+
7372
- name: Run pytest
74-
run: PYTHONPATH=. pytest
73+
run: |
74+
PYTHONPATH=. pytest
7575
76-
check_annotations:
77-
name: Check Annotations
76+
annotation_check:
77+
name: Annotation Check
7878
needs:
7979
- flake8
8080
- black
8181
- pytest
8282
# not codeql, as that reports its own status
8383

84-
if: always() && github.event_name == 'pull_request'
85-
86-
runs-on: ubuntu-latest
87-
88-
steps:
89-
- name: Check annotations
90-
uses: OpenTTD/actions/annotation-check@v2
84+
uses: OpenTTD/actions/.github/workflows/rw-annotation-check.yml@v4

0 commit comments

Comments
 (0)