Repository navigation
86 lines (74 loc) · 2.74 KB
/
Copy pathci-python.yml
File metadata and controls
86 lines (74 loc) · 2.74 KB
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
86
name: 'CI: Python Requirements'
permissions:
id-token: write
contents: read
on:
workflow_dispatch:
pull_request:
branches: [main]
paths:
- '.github/workflows/ci-python.yml'
- 'packages/serverless/lib/plugins/python/**'
- 'packages/sf-core/tests/python/**'
push:
branches: [main]
paths:
- '.github/workflows/ci-python.yml'
- 'packages/serverless/lib/plugins/python/**'
- 'packages/sf-core/tests/python/**'
jobs:
test-python:
name: 'Test: Python Requirements (${{ matrix.os }})'
if: ${{ !github.event.pull_request.draft }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ${{ github.event_name == 'pull_request' && fromJSON('["ubuntu-latest"]') || fromJSON('["ubuntu-latest", "gh-windows-latest"]') }}
steps:
- name: 'Checkout Code'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: 'Setup: Node.js'
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24.x
check-latest: true
cache: npm
- name: 'Setup: Enable Corepack'
run: corepack enable npm
- name: 'Setup: AWS Credentials'
uses: aws-actions/configure-aws-credentials@e6de054238d6b7531b4efff3b6587d9aade6a06c # v6.2.3
with:
role-to-assume: ${{ vars.TEST1_ROLE_ARN }}
aws-region: us-east-1
- name: 'Setup: Python'
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: 3.13
- name: 'Install: Python Tools'
run: |
python -m pip install --upgrade pip
python -m pip install pipenv poetry uv && poetry self add poetry-plugin-export
- name: 'Install: Dependencies'
run: npm ci
- name: 'Setup: Link Framework CLI (Unix)'
if: runner.os != 'Windows'
run: |
chmod +x packages/sf-core/bin/sf-core.js
mkdir -p .github/bin
ln -sf "${{ github.workspace }}/packages/sf-core/bin/sf-core.js" \
"${{ github.workspace }}/.github/bin/sls"
echo "${{ github.workspace }}/.github/bin" >> $GITHUB_PATH
- name: 'Setup: Link Framework CLI (Windows)'
if: runner.os == 'Windows'
run: |
node .github/setup-sls-cmd.cjs
echo "${{ github.workspace }}\.github\bin" >> $env:GITHUB_PATH
- name: 'Test: Python Requirements'
run: |
npm run test:python -w packages/sf-core
env:
SERVERLESS_LICENSE_KEY: ${{ secrets.SERVERLESS_LICENSE_KEY_DEV }}
SLS_AWS_SDK: 3
SERVERLESS_PLATFORM_STAGE: dev
TEST_STAGE: pr-${{ github.event.pull_request.user.login }}