35
35
default : false
36
36
required : false
37
37
type : boolean
38
- secrets : inherit
38
+
39
+ env :
40
+ legacy_dir : tests/legacy
39
41
40
42
defaults :
41
43
run :
46
48
runs-on : ubuntu-20.04
47
49
outputs :
48
50
pl-version : ${{ steps.decide-version.outputs.pl-version }}
49
- defaults :
50
- run :
51
- working-directory : tests/legacy
52
51
steps :
53
52
- uses : actions/checkout@v3
54
53
65
64
aws-region : us-east-1
66
65
67
66
- name : Install PL from source
68
- working-directory : ./
69
67
env :
70
68
PACKAGE_NAME : pytorch
71
69
FREEZE_REQUIREMENTS : 1
81
79
pip list
82
80
if : inputs.pl_version != ''
83
81
82
+ - name : Adjust tests -> PL
83
+ if : ${{ matrix.pkg-name != 'lightning' }}
84
+ run : |
85
+ pip install -q -r .actions/requirements.txt
86
+ python .actions/assistant.py copy_replace_imports --source_dir="./tests" \
87
+ --source_import="lightning.fabric,lightning.pytorch" \
88
+ --target_import="lightning_fabric,pytorch_lightning"
89
+
84
90
- name : Pull legacy checkpoints
85
- working-directory : ./
86
91
run : bash .actions/pull_legacy_checkpoints.sh
87
92
88
93
- name : Decide PL version to create a PR with
@@ -91,29 +96,32 @@ jobs:
91
96
python -c "import pytorch_lightning as pl; print(f'pl-version={pl.__version__}')" >> $GITHUB_OUTPUT || echo pl-version='' >> $GITHUB_OUTPUT
92
97
93
98
- name : Generate checkpoints
99
+ working-directory : ${{ env.legacy_dir }}
94
100
run : |
95
101
bash generate_checkpoints.sh ${{ inputs.pl_version }}
96
102
97
103
- name : Upload checkpoints to GitHub Actions artifact
98
104
uses : actions/upload-artifact@v3
99
105
with :
100
106
name : checkpoints-${{ github.sha }}
101
- path : tests/legacy /checkpoints/
107
+ path : ${{ env.legacy_dir }} /checkpoints/
102
108
103
109
- name : Upload checkpoints to S3 (dryrun)
110
+ working-directory : ${{ env.legacy_dir }}
104
111
run : |
105
112
aws s3 sync --dryrun checkpoints/ s3://pl-public-data/legacy/checkpoints/
106
113
zip -r checkpoints.zip checkpoints
107
114
aws s3 cp --dryrun checkpoints.zip s3://pl-public-data/legacy/ --acl public-read
108
115
109
116
- name : Upload checkpoints to S3
117
+ working-directory : ${{ env.legacy_dir }}
110
118
run : |
111
119
aws s3 sync checkpoints/ s3://pl-public-data/legacy/checkpoints/
112
120
zip -r checkpoints.zip checkpoints
113
121
aws s3 cp checkpoints.zip s3://pl-public-data/legacy/ --acl public-read
114
122
if : inputs.push_to_s3
115
123
116
- adding -ckpt-test :
124
+ add -ckpt-test :
117
125
runs-on : ubuntu-20.04
118
126
if : inputs.create_pr
119
127
needs : create-legacy-ckpts
@@ -123,7 +131,7 @@ jobs:
123
131
ref : master
124
132
125
133
- name : Append a new version to legacy checkpoint list
126
- run : echo ${{ needs.create-legacy-ckpts.outputs.pl-version }} >> tests/legacy /back-compatible-versions.txt
134
+ run : echo ${{ needs.create-legacy-ckpts.outputs.pl-version }} >> ${{ env.legacy_dir }} /back-compatible-versions.txt
127
135
128
136
- name : Create Pull Request
129
137
uses : peter-evans/create-pull-request@v4
0 commit comments