]> git.nega.tv - josh/narcissus/commitdiff
[meta] Update rust in github actions
authorJosh Simmons <josh@nega.tv>
Sun, 6 Nov 2022 10:45:09 +0000 (11:45 +0100)
committerGitHub <noreply@github.com>
Sun, 6 Nov 2022 10:45:09 +0000 (11:45 +0100)
.github/workflows/rust.yml

index b6d4ca47ef4c1541e69a2b9c91df2584623d7ab3..86ac61004b76ef5ba91b61d76aa751bd0a80cbfd 100644 (file)
@@ -19,6 +19,28 @@ jobs:
       run: |
         sudo apt-get update
         sudo apt-get install libsdl2-dev clang llvm
+    - name: install_rustup
+      run: |
+        : install rustup if needed
+        if ! command -v rustup &> /dev/null ; then
+          curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
+          echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
+        fi
+      shell: bash
+      if: runner.os != 'Windows'
+      
+    - name: update_rust
+      run: |
+        rustup update
+
+    - name: setup_rust
+      run: |
+        : disable incremental compilation
+        echo CARGO_INCREMENTAL=0 >> $GITHUB_ENV
+        : enable colors in Cargo output
+        echo CARGO_TERM_COLOR=always >> $GITHUB_ENV
+      shell: bash
+
     - name: install_mold
       run: |
         version=$(wget -q -O- https://api.github.com/repos/rui314/mold/releases/latest | jq -r .tag_name | sed 's/^v//'); true