This repository was archived by the owner on Nov 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 117
85 lines (81 loc) · 2.78 KB
/
rust.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
name: Rust
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
SHELL: /bin/bash
jobs:
Build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
rust: [beta, stable]
features: ["--features debugmozjs", ""]
exclude:
- os: windows-latest
rust: beta
steps:
- uses: actions/checkout@v2
- name: Install deps on osx
if: startsWith(matrix.os, 'macOS')
run: |
brew install python [email protected] ccache llvm yasm
- name: Install deps on linux
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt install autoconf2.13 gcc-7 g++-7 ccache llvm -y
- name: Install deps on windows
if: startsWith(matrix.os, 'windows')
run: |
Start-BitsTransfer -Source https://ftp.mozilla.org/pub/mozilla/libraries/win32/MozillaBuildSetup-3.4.exe -Destination ./MozillaBuildSetup.exe
.\MozillaBuildSetup.exe /S | Out-Null
iwr -useb get.scoop.sh -outfile 'install.ps1'
.\install.ps1 -RunAsAdmin
scoop install [email protected] --global
echo "C:\ProgramData\scoop\shims;C:\Users\runneradmin\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
default: true
- name: ccache cache files
if: startsWith(matrix.os, 'windows') != true
uses: actions/[email protected]
with:
path: .ccache
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Build POSIX
if: startsWith(matrix.os, 'windows') != true
run: |
ccache -z
ccache cargo build --verbose ${{ matrix.features }}
ccache cargo test --verbose ${{ matrix.features }}
ccache -s
- name: Build Windows
if: startsWith(matrix.os, 'windows')
shell: cmd
env:
MOZTOOLS_PATH: 'C:\mozilla-build\msys\bin;C:\mozilla-build\bin'
AUTOCONF: "C:/mozilla-build/msys/local/bin/autoconf-2.13"
LINKER: "lld-link.exe"
CC: "clang-cl.exe"
CXX: "clang-cl.exe"
NATIVE_WIN32_PYTHON: "C:\\mozilla-build\\python\\python.exe"
PYTHON3: "C:\\mozilla-build\\python3\\python3.exe"
LIBCLANG_PATH: "C:\\ProgramData\\scoop\\apps\\llvm\\current\\lib"
CARGO_HOME: ${{ github.workspace }}\..\.cargo
run: |
cargo test --verbose --verbose ${{ matrix.features }} --lib
build_result:
name: homu build finished
runs-on: ubuntu-latest
needs: ["Build"]
steps:
- name: Mark the job as successful
run: exit 0
if: success()
- name: Mark the job as unsuccessful
run: exit 1
if: "!success()"