diff options
Diffstat (limited to '.github/workflows/ci.yaml')
-rw-r--r-- | .github/workflows/ci.yaml | 149 |
1 files changed, 73 insertions, 76 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 50c4265cf..633015956 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml | |||
@@ -3,28 +3,30 @@ on: | |||
3 | pull_request: | 3 | pull_request: |
4 | push: | 4 | push: |
5 | branches: | 5 | branches: |
6 | - master | 6 | - master |
7 | - staging | 7 | - staging |
8 | - trying | 8 | - trying |
9 | 9 | ||
10 | jobs: | 10 | jobs: |
11 | rust-audit: | 11 | rust-audit: |
12 | name: Audit Rust vulnerabilities | 12 | name: Audit Rust vulnerabilities |
13 | runs-on: ubuntu-latest | 13 | runs-on: ubuntu-latest |
14 | steps: | 14 | steps: |
15 | - name: Checkout repository | 15 | - name: Checkout repository |
16 | uses: actions/checkout@v1 | 16 | uses: actions/checkout@v1 |
17 | 17 | ||
18 | - run: cargo install cargo-audit | 18 | - run: cargo install cargo-audit |
19 | - run: cargo audit | 19 | - run: cargo audit |
20 | 20 | ||
21 | rust: | 21 | rust: |
22 | name: Rust | 22 | name: Rust |
23 | runs-on: ${{ matrix.os }} | 23 | runs-on: ${{ matrix.os }} |
24 | |||
24 | strategy: | 25 | strategy: |
25 | fail-fast: false | 26 | fail-fast: false |
26 | matrix: | 27 | matrix: |
27 | os: [ubuntu-latest, windows-latest, macos-latest] | 28 | os: [ubuntu-latest, windows-latest, macos-latest] |
29 | |||
28 | env: | 30 | env: |
29 | RUSTFLAGS: -D warnings | 31 | RUSTFLAGS: -D warnings |
30 | CC: deny_c | 32 | CC: deny_c |
@@ -32,62 +34,57 @@ jobs: | |||
32 | RUN_SLOW_TESTS: 1 | 34 | RUN_SLOW_TESTS: 1 |
33 | RUSTUP_MAX_RETRIES: 10 | 35 | RUSTUP_MAX_RETRIES: 10 |
34 | CARGO_NET_RETRY: 10 | 36 | CARGO_NET_RETRY: 10 |
35 | steps: | ||
36 | 37 | ||
37 | - name: Checkout repository | 38 | steps: |
38 | uses: actions/checkout@v1 | 39 | - name: Checkout repository |
39 | 40 | uses: actions/checkout@v1 | |
40 | # We need to disable the existing toolchain to avoid updating rust-docs | 41 | |
41 | # which takes a long time. The fastest way to do this is to rename the | 42 | # We need to disable the existing toolchain to avoid updating rust-docs |
42 | # existing folder, as deleting it takes about as much time as not doing | 43 | # which takes a long time. The fastest way to do this is to rename the |
43 | # anything and just updating rust-docs. | 44 | # existing folder, as deleting it takes about as much time as not doing |
44 | - name: Rename existing rust toolchain (Windows) | 45 | # anything and just updating rust-docs. |
45 | if: matrix.os == 'windows-latest' | 46 | - name: Rename existing rust toolchain (Windows) |
46 | run: Rename-Item C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc.old | 47 | if: matrix.os == 'windows-latest' |
47 | 48 | run: Rename-Item C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc.old | |
48 | - name: Install Rust toolchain | 49 | |
49 | uses: actions-rs/toolchain@v1 | 50 | - name: Install Rust toolchain |
50 | with: | 51 | uses: actions-rs/toolchain@v1 |
51 | toolchain: stable | 52 | with: |
52 | profile: minimal | 53 | toolchain: stable |
53 | override: true | 54 | profile: minimal |
54 | components: rustfmt, rust-src | 55 | override: true |
55 | 56 | components: rustfmt, rust-src | |
56 | - name: Cache cargo registry | 57 | |
57 | uses: actions/cache@v1 | 58 | - name: Cache cargo registry |
58 | with: | 59 | uses: actions/cache@v1 |
59 | path: ~/.cargo/registry | 60 | with: |
60 | key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | 61 | path: ~/.cargo/registry |
61 | 62 | key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
62 | - name: Cache cargo index | 63 | |
63 | uses: actions/cache@v1 | 64 | - name: Cache cargo index |
64 | with: | 65 | uses: actions/cache@v1 |
65 | path: ~/.cargo/git | 66 | with: |
66 | key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | 67 | path: ~/.cargo/git |
67 | 68 | key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
68 | - name: Cache cargo target dir | 69 | |
69 | uses: actions/cache@v1 | 70 | - name: Cache cargo target dir |
70 | with: | 71 | uses: actions/cache@v1 |
71 | path: target | 72 | with: |
72 | key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | 73 | path: target |
73 | 74 | key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | |
74 | - name: Compile | 75 | |
75 | uses: actions-rs/cargo@v1 | 76 | - name: Compile |
76 | with: | 77 | run: cargo test --no-run |
77 | command: test | 78 | |
78 | args: --no-run | 79 | - name: Test |
79 | 80 | run: cargo test | |
80 | - name: Test | 81 | |
81 | uses: actions-rs/cargo@v1 | 82 | - name: Prepare cache |
82 | with: | 83 | run: cargo xtask pre-cache |
83 | command: test | 84 | |
84 | 85 | - name: Prepare cache 2 | |
85 | - name: Prepare cache | 86 | if: matrix.os == 'windows-latest' |
86 | run: cargo xtask pre-cache | 87 | run: Remove-Item ./target/debug/xtask.exe, ./target/debug/deps/xtask.exe |
87 | |||
88 | - name: Prepare cache 2 | ||
89 | if: matrix.os == 'windows-latest' | ||
90 | run: Remove-Item ./target/debug/xtask.exe, ./target/debug/deps/xtask.exe | ||
91 | 88 | ||
92 | typescript: | 89 | typescript: |
93 | name: TypeScript | 90 | name: TypeScript |
@@ -96,22 +93,22 @@ jobs: | |||
96 | CXX: g++-4.9 | 93 | CXX: g++-4.9 |
97 | CC: gcc-4.9 | 94 | CC: gcc-4.9 |
98 | steps: | 95 | steps: |
99 | - name: Checkout repository | 96 | - name: Checkout repository |
100 | uses: actions/checkout@v1 | 97 | uses: actions/checkout@v1 |
101 | 98 | ||
102 | - name: Install Nodejs | 99 | - name: Install Nodejs |
103 | uses: actions/setup-node@v1 | 100 | uses: actions/setup-node@v1 |
104 | with: | 101 | with: |
105 | node-version: 12.x | 102 | node-version: 12.x |
106 | 103 | ||
107 | - run: npm ci | 104 | - run: npm ci |
108 | working-directory: ./editors/code | 105 | working-directory: ./editors/code |
109 | 106 | ||
110 | - run: npm audit | 107 | - run: npm audit |
111 | working-directory: ./editors/code | 108 | working-directory: ./editors/code |
112 | 109 | ||
113 | - run: npm run lint | 110 | - run: npm run lint |
114 | working-directory: ./editors/code | 111 | working-directory: ./editors/code |
115 | 112 | ||
116 | - run: npm run package --scripts-prepend-node-path | 113 | - run: npm run package --scripts-prepend-node-path |
117 | working-directory: ./editors/code | 114 | working-directory: ./editors/code |