Skip to content

Commit 0f1e147

Browse files
committed
feature/workflow checks if contributor is a collaborator
1 parent cbea8fc commit 0f1e147

File tree

3 files changed

+71
-89
lines changed

3 files changed

+71
-89
lines changed

.github/workflows/contributer_action.yml

-81
This file was deleted.

.github/workflows/contributor.yml

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Python Package - Contributor
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test:
10+
if: >
11+
github.event.pull_request.head.repo.fork == true ||
12+
!(
13+
contains(github.event.pull_request.author_association, 'COLLABORATOR') ||
14+
contains(github.event.pull_request.author_association, 'MEMBER') ||
15+
contains(github.event.pull_request.author_association, 'OWNER')
16+
)
17+
runs-on: ubuntu-20.04
18+
strategy:
19+
matrix:
20+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
21+
steps:
22+
- name: Debug event payload
23+
run: |
24+
echo "Fork: ${{ github.event.pull_request.head.repo.fork }}"
25+
echo "Author Association: ${{ github.event.pull_request.author_association }}"
26+
- uses: actions/checkout@v4
27+
- name: Set up Python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install -r test_requirements.txt
35+
- name: Run tests with pytest
36+
run: |
37+
pytest --cov=./ --cov-report=xml
38+
39+
build-binaries:
40+
needs: test
41+
runs-on: ${{ matrix.os }}
42+
strategy:
43+
matrix:
44+
os: ['windows-latest', 'ubuntu-20.04', 'macos-latest']
45+
steps:
46+
- uses: actions/checkout@v4
47+
- name: Set up Python
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version: '3.13'
51+
- name: Install Dependencies
52+
run: |
53+
python -m pip install --upgrade pip
54+
python binaries.py install
55+
- name: Test Binaries
56+
run: python binaries.py test
57+
- name: Build Binaries
58+
run: python binaries.py dist
59+
- uses: actions/upload-artifact@v4
60+
with:
61+
name: ${{ matrix.os }}-binary
62+
path: dist/
63+
if-no-files-found: error

.github/workflows/main.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-20.04
88
strategy:
99
matrix:
10-
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
10+
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ]
1111
steps:
1212
- uses: actions/checkout@v3
1313
- name: Set up Python
@@ -46,36 +46,36 @@ jobs:
4646
env:
4747
BINARY_OS: '${{ matrix.os }}'
4848
steps:
49-
- uses: actions/checkout@v3
49+
- uses: actions/checkout@v4
5050
- name: Set up Python
51-
uses: actions/setup-python@v4
51+
uses: actions/setup-python@v5
5252
with:
53-
python-version: '3.10'
53+
python-version: '3.13'
5454
- name: Install Dependencies
5555
run: python binaries.py install
5656
- name: Test Safety
5757
run: python binaries.py test
5858
- name: Producing Binaries
5959
run: python binaries.py dist
60-
- uses: actions/upload-artifact@v3
60+
- uses: actions/upload-artifact@v4
6161
if: ${{ matrix.os == 'windows-latest' }}
6262
with:
6363
name: safety-win-i686.exe
6464
path: dist/safety-win-i686.exe
6565
if-no-files-found: error
66-
- uses: actions/upload-artifact@v3
66+
- uses: actions/upload-artifact@v4
6767
if: ${{ matrix.os == 'windows-latest' }}
6868
with:
6969
name: safety-win-x86_64.exe
7070
path: dist/safety-win-x86_64.exe
7171
if-no-files-found: error
72-
- uses: actions/upload-artifact@v3
72+
- uses: actions/upload-artifact@v4
7373
if: ${{ matrix.os == 'ubuntu-20.04' }}
7474
with:
7575
name: safety-linux-x86_64
7676
path: dist/safety-linux-x86_64
7777
if-no-files-found: error
78-
- uses: actions/upload-artifact@v3
78+
- uses: actions/upload-artifact@v4
7979
if: ${{ matrix.os == 'macos-latest' }}
8080
with:
8181
name: safety-macos-x86_64

0 commit comments

Comments
 (0)