forked from Kong/kong
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
79 lines (71 loc) 路 2.55 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
name: Build WASM Test Filters
description: >
Installs the rust toolchain and builds the WASM filters that are used
in our integration tests
runs:
using: composite
steps:
- name: Setup env vars
shell: bash
run: |
WASM_FILTER_PATH=$PWD/spec/fixtures/proxy_wasm_filters
echo "WASM_FILTER_PATH=$WASM_FILTER_PATH" >> $GITHUB_ENV
echo "WASM_FIXTURE_PATH=$WASM_FILTER_PATH/build" >> $GITHUB_ENV
echo "WASM_FILTER_CARGO_LOCK=$WASM_FILTER_PATH/Cargo.lock" >> $GITHUB_ENV
echo "WASM_FILTER_CACHE_PREFIX=wasm-test-filters::v3::${{ runner.os }}" >> $GITHUB_ENV
- name: Restore Cache
uses: actions/cache/restore@v3
id: restore-cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
${{ env.WASM_FILTER_PATH }}/target
key: ${{ env.WASM_FILTER_CACHE_PREFIX }}::${{ hashFiles(env.WASM_FILTER_CARGO_LOCK, format('{0}/**/*.rs', env.WASM_FILTER_PATH)) }}
restore-keys: ${{ env.WASM_FILTER_CACHE_PREFIX }}
- name: Install Rust Toolchain
if: steps.restore-cache.outputs.cache-hit != 'true'
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: cargo
target: wasm32-wasi
- name: cargo build
if: steps.restore-cache.outputs.cache-hit != 'true'
uses: actions-rs/cargo@v1
with:
command: build
# building in release mode yields smaller library sizes, so it's
# better for our cacheability
args: >
--manifest-path "${{ env.WASM_FILTER_PATH }}/Cargo.toml"
--workspace
--lib
--target wasm32-wasi
--release
- name: Save cache
if: steps.restore-cache.outputs.cache-hit != 'true'
id: save-cache
uses: actions/cache/save@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
${{ env.WASM_FILTER_PATH }}/target
key: ${{ env.WASM_FILTER_CACHE_PREFIX }}::${{ hashFiles(env.WASM_FILTER_CARGO_LOCK, format('{0}/**/*.rs', env.WASM_FILTER_PATH)) }}
- name: Create a symlink to the target directory
shell: bash
run: |
ln -sfv \
--no-target-directory \
"${{ env.WASM_FILTER_PATH }}"/target/wasm32-wasi/release \
"${{ env.WASM_FIXTURE_PATH }}"
- name: debug
shell: bash
run: ls -la "${{ env.WASM_FIXTURE_PATH }}"/*.wasm