From 05219c3ce8d091b0d3da62f7d2ec0935153b4a7c Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Wed, 31 Jan 2024 19:10:39 -0500 Subject: [PATCH] Windows Clippy (#525) * Add windows clippy * Adjust build-dependencies for Linux/Windows * Specifically use bash as a shell to try and get rustup to work on Windows * Use bash for the call to echo --- .github/actions/build-dependencies/action.yml | 11 +++++++++-- .github/workflows/lint.yml | 8 +++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/actions/build-dependencies/action.yml b/.github/actions/build-dependencies/action.yml index bc8db571..1d5adc07 100644 --- a/.github/actions/build-dependencies/action.yml +++ b/.github/actions/build-dependencies/action.yml @@ -20,15 +20,22 @@ runs: sudo apt autoremove -y sudo apt clean docker system prune -a --volumes + if: runner.os == 'Linux' - - name: Install apt dependencies + - name: Install dependencies shell: bash - run: sudo apt install -y ca-certificates + run: | + if [ "$RUNNER_OS" == "Linux" ]; then + sudo apt install -y ca-certificates + elif [ "$RUNNER_OS" == "Windows" ]; then + choco install protoc + fi - name: Install Protobuf uses: arduino/setup-protoc@a8b67ba40b37d35169e222f3bb352603327985b6 with: repo-token: ${{ inputs.github-token }} + if: runner.os == 'Linux' - name: Install solc shell: bash diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 16707555..fd26e4dd 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,12 +9,17 @@ on: jobs: clippy: - runs-on: ubuntu-latest + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac - name: Get nightly version to use id: nightly + shell: bash run: echo "version=$(cat .github/nightly-version)" >> $GITHUB_OUTPUT - name: Build Dependencies @@ -60,6 +65,7 @@ jobs: - name: Get nightly version to use id: nightly + shell: bash run: echo "version=$(cat .github/nightly-version)" >> $GITHUB_OUTPUT - name: Install nightly rust