-
Notifications
You must be signed in to change notification settings - Fork 233
76 lines (75 loc) · 2.69 KB
/
ci_unit_tests_windows.yaml
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
name: ci_unit_tests_windows
concurrency:
group: ci_unit_tests_windows-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
types: [ opened, synchronize, reopened ]
push:
branches:
- master
- develop
- 'rc/*'
merge_group: {}
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUSTFLAGS: -D warnings
jobs:
prologue:
name: prologue
if: |
github.event_name != 'push' ||
( github.event_name == 'push' &&
( github.ref == 'refs/heads/master' ||
(github.ref == 'refs/heads/develop' && startsWith(github.event.head_commit.message, 'Merge pull request #')) ||
startsWith(github.ref, 'refs/heads/rc/')
)
) || (github.repository_owner != 'nervosnetwork')
runs-on: ubuntu-20.04
outputs:
os_skip: ${{ steps.prologue.outputs.os_skip }}
job_skip: ${{ steps.prologue.outputs.job_skip }}
windows_runner_label: ${{ steps.prologue.outputs.windows_runner_label }}
steps:
- uses: actions/checkout@v3
- name: prologue
id: prologue
uses: ./.github/actions/ci_prologue
with:
GITHUB_EVENT_NAME: ${{ github.event_name }}
COMMIT_MESSAGE: "${{github.event.head_commit.message}}"
PR_COMMONS_BODY: "${{ github.event.pull_request.body }}"
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
LABELS: "${{ toJson(github.event.pull_request.labels.*.name) }}"
GITHUB_REPOSITORY: ${{ github.repositoty }}
GITHUB_WORKFLOW: ${{ github.workflow }}
ci_unit_tests_windows:
name: ci_unit_tests_windows
needs: prologue
runs-on: ${{ needs.prologue.outputs.windows_runner_label }}
steps:
- uses: actions/checkout@v3
- name: install required tools
if: ${{ needs.prologue.outputs.windows_runner_label == 'windows-2019' }}
run: |
iwr -useb get.scoop.sh -outfile 'install-scoop.ps1'
.\install-scoop.ps1 -RunAsAdmin
echo "$env:USERPROFILE\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "${{ github.workspace }}\devtools\windows" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
scoop install git
scoop bucket add extras
scoop install llvm
- name: Install nextest-rs/nextest
uses: taiki-e/install-action@nextest
- run: |
if [[ ${{ needs.prologue.outputs.os_skip }} == run ]] && [[ ${{ needs.prologue.outputs.job_skip }} == run ]];then
devtools/ci/ci_main.sh
else
echo "skip job"
exit 0
fi
shell: bash
env:
RUNNER_LABEL: ${{ needs.prologue.outputs.windows_runner_label }}