Skip to content

Commit 4656e23

Browse files
committed
iterate on workflow syntax
1 parent b78aa94 commit 4656e23

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

.github/workflows/swift.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Install Swift Toolchain
3737
run: |
3838
pwd
39-
echo `pwd`
39+
cd ci
4040
curl --verbose -L -o swift-5.6-RELEASE-ubuntu20.04.tar.gz https://download.swift.org/swift-5.6-release/ubuntu2004/swift-5.6-RELEASE/swift-5.6-RELEASE-ubuntu20.04.tar.gz
4141
echo "Sha sum: $(sha256sum swift-5.6-RELEASE-ubuntu20.04.tar.gz | awk '{ print $1 }')"
4242
if [ "$(sha256sum swift-5.6-RELEASE-ubuntu20.04.tar.gz | awk '{ print $1 }')" != "${EXPECTED_SWIFT_SHASUM}" ]; then
@@ -56,14 +56,19 @@ jobs:
5656
run: cargo install --force cbindgen
5757
- name: Regenerate C bindings
5858
run: |
59+
pwd
5960
cd ci/ldk-c-bindings
61+
pwd
6062
./genbindings.sh ../rust-lightning true
6163
cd ..
6264
- name: Debug bindings target directory structure
6365
run: |
66+
cd ci
67+
pwd
6468
python ./walker.py ldk-c-bindings/lightning-c-bindings/target
6569
- name: Copy new headers into bindings
6670
run: |
71+
cd ci
6772
mkdir -p ./LDKSwift/Sources/LDKHeaders/include
6873
cp ldk-c-bindings/lightning-c-bindings/include/*.h ./LDKSwift/Sources/LDKHeaders/include/
6974
cp ldk-c-bindings/ldk-net/ldk_net.h ./LDKSwift/Sources/LDKHeaders/include/
@@ -72,32 +77,32 @@ jobs:
7277
uses: actions/setup-python@v2
7378
- name: Fix header files
7479
run: |
80+
cd ci
7581
python ./fix_header_includes.py
7682
- name: Generate (copy for debugging) Swift bindings and copy batteries
7783
run: |
78-
cd ../
84+
pwd
7985
python ./ # Generate bindings
8086
8187
# TODO: switch back to generation method after debugging
8288
# mkdir -p ci/LDKSwift/Sources/LDKSwift
8389
# cp -a bindings/LDK/. ci/LDKSwift/Sources/LDKSwift
8490
8591
cp -R bindings/batteries ci/LDKSwift/Sources/LDKSwift
86-
cd ci
8792
env:
8893
LDK_SWIFT_GENERATOR_INPUT_HEADER_PATH: ldk-c-bindings/lightning-c-bindings/include/lightning.h
8994
LDK_SWIFT_GENERATOR_OUTPUT_DIRECTORY_PATH: ci/LDKSwift/Sources/LDKSwift
9095
- name: Fix Swift files
9196
run: |
97+
cd ci
9298
python ./fix_swift_imports.py
9399
- name: Debug CI directory structure
94100
run: |
95-
python ./walker.py ci/
101+
python ci/walker.py ci/
96102
- name: Build Swift bindings package
97103
run: |
98-
cd LDKSwift
104+
cd ci/LDKSwift
99105
../swift-5.6-RELEASE-ubuntu20.04/usr/bin/swift build
100-
cd ../
101106
env:
102107
LDK_C_BINDINGS_BASE: /home/runner/work/ldk-swift/ldk-swift/ldk-c-bindings
103108
LLVM_CLANG_ASAN_PATH: /usr/lib/llvm-11/lib/clang/11.0.0/lib/linux/libclang_rt.asan-x86_64.a
@@ -107,22 +112,21 @@ jobs:
107112
uses: actions/upload-artifact@v3
108113
with:
109114
name: ci_archive
110-
path: ./
115+
path: ci
111116

112117
- name: Test Swift bindings package without address sanitizer
113118
run: |
114-
python ./toggle_address_sanitation_library.py off
115-
cd LDKSwift
119+
python ci/toggle_address_sanitation_library.py off
120+
cd ci/LDKSwift
116121
../swift-5.6-RELEASE-ubuntu20.04/usr/bin/swift test -v
117-
cd ../
118122
env:
119123
LDK_C_BINDINGS_BASE: /home/runner/work/ldk-swift/ldk-swift/ldk-c-bindings
120124
LLVM_CLANG_ASAN_PATH: /usr/lib/llvm-11/lib/clang/11.0.0/lib/linux/libclang_rt.asan-x86_64.a
121125
RUST_BACKTRACE: 1
122126
- name: Test Swift bindings package with address sanitizer
123127
run: |
124-
python ./toggle_address_sanitation_library.py on
125-
cd LDKSwift
128+
python ci/toggle_address_sanitation_library.py on
129+
cd ci/LDKSwift
126130
../swift-5.6-RELEASE-ubuntu20.04/usr/bin/swift test -v
127131
env:
128132
LDK_C_BINDINGS_BASE: /home/runner/work/ldk-swift/ldk-swift/ldk-c-bindings

0 commit comments

Comments
 (0)