This repository has been archived by the owner on Mar 20, 2024. It is now read-only.
forked from move-language/move
-
Notifications
You must be signed in to change notification settings - Fork 34
134 lines (126 loc) · 5.21 KB
/
llvm-ci-pre-land.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# CI jobs to be run upon the code lands to the main branch or GitHub Action test branches.
name: llvm-ci-pre-land
on:
pull_request:
branches: [main, llvm-sys, gha-test-*]
workflow_dispatch:
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
changes-target-branch: ${{ steps.changes.outputs.changes-target-branch }}
any-changes-founds: ${{ steps.any-changes-found.outputs.changes-found }}
test-rust: ${{ steps.rust-changes.outputs.changes-found }}
steps:
- uses: actions/[email protected]
- name: Git Hooks and Checks
run: ./scripts/git-checks.sh
- id: changes
name: determine changes
uses: diem/actions/changes@faadd16607b77dfa2231a8f366883e01717b3225
with:
workflow-file: ci.yml
github-token: ${{secrets.GITHUB_TOKEN}}
- id: any-changes-found
name: determine if there are any files listed in the CHANGES_CHANGED_FILE_OUTPUTFILE.
run: |
res=true
if [[ ! -f "$CHANGES_CHANGED_FILE_OUTPUTFILE" ]] || [[ "$(cat "$CHANGES_CHANGED_FILE_OUTPUTFILE" | wc -l)" == 0 ]]; then
res=false;
fi
echo "::set-output name=changes-found::$(echo $res)";
- id: rust-changes
name: find rust/cargo changes.
uses: diem/actions/matches@faadd16607b77dfa2231a8f366883e01717b3225
with:
pattern: '^documentation\|^docker\|^scripts'
invert: "true"
lint:
runs-on: ubuntu-latest
timeout-minutes: 30
needs: prepare
# if: ${{ needs.prepare.outputs.any-changes-founds == 'true' }}
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/build-setup
- uses: Swatinem/rust-cache@c5ed9ba6b7e1bb8aff90d43acd2f0af4990fa57c
- id: acquire_solana_tools
shell: bash
run: |
source ./scripts/acquire_solana_tools.sh
echo "MOVE_DEV_PATH=$MOVE_DEV_PATH" >> $GITHUB_ENV
echo "PLATFORM_TOOLS_PATH=$PLATFORM_TOOLS_PATH" >> $GITHUB_ENV
- name: cargo lint
run: cargo x lint
- name: cargo clippy
run: cargo xclippy --workspace --all-targets
env:
LLVM_SYS_170_PREFIX: ${{ env.MOVE_DEV_PATH }}
PLATFORM_TOOLS_ROOT: ${{ env.PLATFORM_TOOLS_PATH }}
- name: cargo fmt
run: cargo xfmt --check
unit-tests:
uses: ./.github/workflows/unit-test.yml
move-cli-tests-solana:
runs-on: ubuntu-latest
timeout-minutes: 30
needs: prepare
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/build-setup
- uses: Swatinem/rust-cache@c5ed9ba6b7e1bb8aff90d43acd2f0af4990fa57c
- id: acquire_solana_tools
shell: bash
run: |
source ./scripts/acquire_solana_tools.sh
echo "MOVE_DEV_PATH=$MOVE_DEV_PATH" >> $GITHUB_ENV
echo "PLATFORM_TOOLS_PATH=$PLATFORM_TOOLS_PATH" >> $GITHUB_ENV
echo "MOVE_NATIVE_PATH=${{ github.workspace }}/language/move-native" >> $GITHUB_ENV
- name: run Solana-based move cli tests
run: "cargo test --features solana-backend -p move-cli --test build_testsuite_solana --test move_unit_tests_solana -- --test-threads 1"
env:
LLVM_SYS_170_PREFIX: ${{ env.MOVE_DEV_PATH }}
MOVE_NATIVE: ${{ env.MOVE_NATIVE_PATH }}
PLATFORM_TOOLS_ROOT: ${{ env.PLATFORM_TOOLS_PATH }}
move-stdlib-tests-solana:
runs-on: ubuntu-latest
timeout-minutes: 30
needs: prepare
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/build-setup
- uses: Swatinem/rust-cache@c5ed9ba6b7e1bb8aff90d43acd2f0af4990fa57c
- id: acquire_solana_tools
shell: bash
run: |
source ./scripts/acquire_solana_tools.sh
echo "MOVE_DEV_PATH=$MOVE_DEV_PATH" >> $GITHUB_ENV
echo "PLATFORM_TOOLS_PATH=$PLATFORM_TOOLS_PATH" >> $GITHUB_ENV
echo "MOVE_NATIVE_PATH=${{ github.workspace }}/language/move-native" >> $GITHUB_ENV
- name: run Solana-based move stdlib tests
run: "cargo run --features solana-backend -p move-cli --bin move -- test --solana -p language/move-stdlib"
env:
LLVM_SYS_170_PREFIX: ${{ env.MOVE_DEV_PATH }}
MOVE_NATIVE: ${{ env.MOVE_NATIVE_PATH }}
PLATFORM_TOOLS_ROOT: ${{ env.PLATFORM_TOOLS_PATH }}
move-unit-test-framework-tests-solana:
runs-on: ubuntu-latest
timeout-minutes: 30
needs: prepare
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/build-setup
- uses: Swatinem/rust-cache@c5ed9ba6b7e1bb8aff90d43acd2f0af4990fa57c
- id: acquire_solana_tools
shell: bash
run: |
source ./scripts/acquire_solana_tools.sh
echo "MOVE_DEV_PATH=$MOVE_DEV_PATH" >> $GITHUB_ENV
echo "PLATFORM_TOOLS_PATH=$PLATFORM_TOOLS_PATH" >> $GITHUB_ENV
echo "MOVE_NATIVE_PATH=${{ github.workspace }}/language/move-native" >> $GITHUB_ENV
- name: run Solana-based move unit test framework tests
run: "cargo test --features solana-backend -p move-unit-test --test move_unit_test_testsuite -- --test-threads 1"
env:
LLVM_SYS_170_PREFIX: ${{ env.MOVE_DEV_PATH }}
MOVE_NATIVE: ${{ env.MOVE_NATIVE_PATH }}
PLATFORM_TOOLS_ROOT: ${{ env.PLATFORM_TOOLS_PATH }}