| 1 |
# FIXME |
| 2 |
# - Code coverage on Windows does not work because there are problems |
| 3 |
# with grcov paths |
| 4 |
# - valgrind cannot be installed on Windows, only on linux |
| 5 |
# - cargo-fuzz and AddressSanitizer are not supported on Windows |
| 6 |
|
| 7 |
name: av1-grain-windows |
| 8 |
|
| 9 |
on: |
| 10 |
push: |
| 11 |
branches: |
| 12 |
- main |
| 13 |
pull_request: |
| 14 |
branches: |
| 15 |
- main |
| 16 |
|
| 17 |
jobs: |
| 18 |
build-test: |
| 19 |
runs-on: windows-latest |
| 20 |
|
| 21 |
steps: |
| 22 |
- uses: actions/checkout@v3 |
| 23 |
|
| 24 |
- name: Install Rust stable |
| 25 |
uses: actions-rs/toolchain@v1 |
| 26 |
with: |
| 27 |
profile: minimal |
| 28 |
toolchain: stable |
| 29 |
override: true |
| 30 |
components: rustfmt, clippy |
| 31 |
- uses: Swatinem/rust-cache@v2 |
| 32 |
|
| 33 |
- name: Run rustfmt |
| 34 |
uses: actions-rs/cargo@v1 |
| 35 |
with: |
| 36 |
command: fmt |
| 37 |
args: -- --check --verbose |
| 38 |
|
| 39 |
- name: Run cargo clippy |
| 40 |
uses: actions-rs/clippy-check@v1 |
| 41 |
with: |
| 42 |
token: ${{ secrets.GITHUB_TOKEN }} |
| 43 |
args: --all-targets --tests --benches -- -D warnings |
| 44 |
|
| 45 |
- name: Build |
| 46 |
run: cargo build --verbose --tests --benches |
| 47 |
|
| 48 |
- name: Run tests |
| 49 |
run: cargo test --verbose |
| 50 |
|
| 51 |
- name: Generate docs |
| 52 |
run: cargo doc --no-deps |
| 53 |
|
| 54 |
static-code-analysis: |
| 55 |
needs: [build-test] |
| 56 |
runs-on: windows-latest |
| 57 |
|
| 58 |
steps: |
| 59 |
- uses: actions/checkout@v3 |
| 60 |
|
| 61 |
- name: Install rust-code-analysis |
| 62 |
env: |
| 63 |
RCA_LINK: https://github.com/mozilla/rust-code-analysis/releases/download |
| 64 |
RCA_VERSION: v0.0.23 |
| 65 |
run: | |
| 66 |
mkdir -p $HOME/bin |
| 67 |
curl -LO "$Env:RCA_LINK/$env:RCA_VERSION/rust-code-analysis-win-cli-x86_64.zip" |
| 68 |
7z e -y "rust-code-analysis-win-cli-x86_64.zip" -o"$HOME/bin" |
| 69 |
echo "$HOME/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append |
| 70 |
|
| 71 |
- name: Run rust-code-analysis |
| 72 |
run: | |
| 73 |
mkdir $HOME/rca-json |
| 74 |
# FIXME: Update rca version to analyze the entire directory of a repo |
| 75 |
rust-code-analysis-cli --metrics -O json --pr -o "$HOME/rca-json" -p src/ |
| 76 |
|
| 77 |
- name: Upload rust-code-analysis json |
| 78 |
uses: actions/upload-artifact@v4 |
| 79 |
with: |
| 80 |
name: rca-json-windows |
| 81 |
path: ~/rca-json |