-
Notifications
You must be signed in to change notification settings - Fork 7
133 lines (127 loc) · 4.22 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
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
name: Rust
on:
push:
branches: [dev]
pull_request:
branches: [dev]
env:
CARGO_TERM_COLOR: always
jobs:
check:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
rust: [nightly]
include:
- os: ubuntu-latest
sccache-path: /home/runner/.cache/sccache
- os: macos-latest
sccache-path: /Users/runner/Library/Caches/Mozilla.sccache
- os: windows-latest
sccache-path: C:\Users\runner\AppData\Local\Mozilla\sccache
env:
RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache
RUSTV: ${{ matrix.rust }}
SCCACHE_CACHE_SIZE: 2G
SCCACHE_DIR: ${{ matrix.sccache-path }}
steps:
- uses: actions/checkout@v2
- name: Install sccache (ubuntu-latest)
if: matrix.os == 'ubuntu-latest'
env:
LINK: https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION: 0.2.13
run: |
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl
mkdir -p $HOME/.local/bin
curl -L "$LINK/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz
mv -f $SCCACHE_FILE/sccache $HOME/.local/bin/sccache
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install sccache (macos-latest)
if: matrix.os == 'macos-latest'
run: |
brew install sccache
- name: Install sccache (windows-latest)
if: matrix.os == 'windows-latest'
run: |
choco install sccache
- name: Install Rust ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: false
default: true
- name: Cache cargo registry
uses: actions/cache@v2
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-v1-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-v1
- name: Save sccache
uses: actions/cache@v2
continue-on-error: false
with:
path: ${{ matrix.sccache-path }}
key: ${{ runner.os }}-sccache-v1-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-sccache-v1
- name: Start sccache server
run: sccache --start-server
- name: Build
run: cargo build --release
- name: Run tests
run: cargo test --release -- --test-threads 1
- name: Submodule update
run: git submodule update --init
- name: Run test262 tests
run: cargo run --release --bin test262-runner run -o new
# Run the test suite and upload the results
# Run the results comparison
- name: Checkout Test262 Results
uses: actions/checkout@v2.3.4
with:
ref: test262-base
path: test262-base
- name: Compare results
id: compare
shell: bash
run: |
comment=$(cargo run --release --bin test262-runner compare test262-base/basic/latest.json new/latest.json -m -d | jq --raw-input --slurp '.')
echo $comment > ./comment.txt
echo $comment
- name: Upload comment artifact
if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v2
with:
name: comment
path: ./comment.txt
retention-days: 3
# Upload PR id for next workflow use
- name: Save PR number
if: github.event_name == 'pull_request'
run: echo ${{ github.event.number }} > ./pr-id.txt
- name: Upload PR number
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v2
with:
name: pr
path: ./pr-id.txt
- name: Upload New Results
if: github.event_name == 'push' && matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v2
with:
name: new
path: ./new/
- name: Print sccache stats
run: sccache --show-stats
- name: Stop sccache server
run: sccache --stop-server || true