-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
85 lines (70 loc) · 2.21 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: "Python Rust Mixed Project Build Test"
author: Soumyo Deep Gupta (@d33pster or @d33p0st)
description: "Build test for python and rust mix projects using maturin."
branding:
icon: box
color: black
inputs:
python-version:
description: "Python version to use."
required: false
default: 3.12
miniconda-version:
description: "Set miniconda version."
required: false
default: "latest"
replace:
description: "set replace on off."
required: false
default: false
GH_TOKEN:
description: "API"
required: false
default: ${{ github.token }}
runs:
using: "composite"
steps:
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: ${{ inputs.miniconda-version }}
python-version: ${{ inputs.python-version }}
activate-environment: rustmix
- name: Install maturin
shell: bash -el {0}
run: |
conda info
pip install maturin gitpython
- name: Create __all_files__
shell: bash -el {0}
run: |
if [[ "$RUNNER_OS" == "Linux" || "$RUNNER_OS" == "macOS" ]]; then
PRESYNC="$action_path/codes/presync.py"
elif [[ "$RUNNER_OS" == "Windows" ]]; then
PRESYNC="$action_path\codes\presync.py"
fi
python $PRESYNC
env:
action_path: ${{ github.action_path }}
- name: Run Build
shell: bash -el {0}
run: maturin develop
- name: Set env variable for replace
id: set-env
shell: bash -el {0}
run: echo "REPLACE=${{ inputs.replace }}" >> $GITHUB_ENV
- name: Check and Replace
shell: bash -el {0}
run: |
if [ "${{ env.REPLACE }}" == "true" ]; then
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
if [[ "$RUNNER_OS" == "Linux" || "$RUNNER_OS" == "macOS" ]]; then
SYNC="$action_path/codes/sync.py"
elif [[ "$RUNNER_OS" == "Windows" ]]; then
SYNC="$action_path\codes\sync.py"
fi
python $SYNC
fi
env:
GITHUB_TOKEN: ${{ inputs.GH_TOKEN }}
action_path: ${{ github.action_path }}