From 75ee89e83d5911ffa5414af86180bc6d7f654de6 Mon Sep 17 00:00:00 2001
From: Murph Murphy <murph@clurictec.com>
Date: Tue, 31 Jan 2023 14:18:44 -0700
Subject: [PATCH] Fix workflows so pr isn't messy

---
 .github/workflows/ci.yml   | 44 ++++++++++++++++++++++++++++++++++++++
 .github/workflows/sync.yml | 12 -----------
 README.md                  | 14 ++++++------
 3 files changed, 51 insertions(+), 19 deletions(-)
 create mode 100644 .github/workflows/ci.yml
 delete mode 100644 .github/workflows/sync.yml

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..c77aff2
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,44 @@
+name: CI
+
+on:
+  push:
+    branches: [master]
+  pull_request:
+  schedule: [cron: "40 1 * * *"]
+
+permissions:
+  contents: read
+
+jobs:
+  install:
+    name: Rust ${{matrix.rust}} on ${{matrix.os == 'ubuntu' && 'Linux' || matrix.os == 'macos' && 'macOS' || matrix.os == 'windows' && 'Windows' || '???'}}
+    runs-on: ${{matrix.os}}-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        os: [ubuntu, macos, windows]
+        rust: [nightly, beta, stable, 1.62.0, stable 18 months ago, stable minus 8 releases]
+        include:
+          - os: ubuntu
+            rust: 1.0.0
+    timeout-minutes: 45
+    steps:
+      - uses: actions/checkout@v3
+      - uses: ./
+        name: Run dtolnay/rust-toolchain${{contains(matrix.rust, ' ') && ' for ' || '@'}}${{matrix.rust}}
+        id: toolchain
+        with:
+          toolchain: ${{matrix.rust}}
+      - name: echo ${{'${{steps.toolchain.outputs.cachekey}}'}}
+        run: echo '${{steps.toolchain.outputs.cachekey}}'
+      - name: check ${{'${{steps.toolchain.outputs.cachekey}}'}}
+        if: matrix.rust == '1.62.0'
+        run: cmp -s <(echo ${{steps.toolchain.outputs.cachekey}}) <(echo 20220627a831)
+        shell: bash
+      - run: rustc --version
+      - run: cargo init . --bin --name CI
+        if: matrix.rust == 'nightly' || matrix.rust == 'beta' || matrix.rust == 'stable'
+      - run: cargo add syn@1
+        if: matrix.rust == 'nightly' || matrix.rust == 'beta' || matrix.rust == 'stable'
+      - run: cargo check
+        if: matrix.rust == 'nightly' || matrix.rust == 'beta' || matrix.rust == 'stable'
diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml
deleted file mode 100644
index e3da3f6..0000000
--- a/.github/workflows/sync.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-name: Rebase Upstream
-on:
-  schedule:
-  - cron: "0 0 * * 0"  # run once a week
-  workflow_dispatch:   # run manually
-
-jobs:
-  sync:
-    runs-on: ubuntu-latest
-    steps:
-    - uses: actions/checkout@master
-    - uses: imba-tjd/rebase-upstream-action@master
diff --git a/README.md b/README.md
index 01197ca..6203873 100644
--- a/README.md
+++ b/README.md
@@ -17,13 +17,13 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v3
-      - uses: IronCoreLabs/rust-toolchain@stable
+      - uses: dtolnay/rust-toolchain@stable
       - run: cargo test --all-features
 ```
 
 The selection of Rust toolchain is made based on the particular @rev of this
-Action being requested. For example "IronCoreLabs/rust-toolchain@nightly" pulls in
-the nightly Rust toolchain, while "IronCoreLabs/rust-toolchain@1.42.0" pulls in
+Action being requested. For example "dtolnay/rust-toolchain@nightly" pulls in
+the nightly Rust toolchain, while "dtolnay/rust-toolchain@1.42.0" pulls in
 1.42.0.
 
 ## Toolchain File
@@ -45,7 +45,7 @@ All inputs are optional.
   <td>
     Rustup toolchain specifier e.g. <code>stable</code>, <code>nightly</code>, <code>1.42.0</code>, <code>nightly-2022-01-01</code>.
     <b>Important: the default is to match the @rev as described above.</b>
-    When passing an explicit <code>toolchain</code> as an input instead of @rev, you'll want to use "IronCoreLabs/rust-toolchain@master" as the revision of the action.
+    When passing an explicit <code>toolchain</code> as an input instead of @rev, you'll want to use "dtolnay/rust-toolchain@master" as the revision of the action.
   </td>
 </tr>
 <tr>
@@ -70,7 +70,7 @@ All inputs are optional.
 <tr>
   <td><code>toolchain</code></td>
   <td>
-    The parsed toolchain that was installed by this action.
+    Rustup's name for the selected version of the toolchain. "1.62.0"
   </td>
 </tr>
 <tr>
@@ -89,7 +89,7 @@ compiler support.
 ```yaml
      # Installs the most recent stable toolchain as of the specified time
      # offset, which may be written in years, months, weeks, or days.
-  - uses: IronCoreLabs/rust-toolchain@master
+  - uses: dtolnay/rust-toolchain@master
     with:
       toolchain: stable 18 months ago
 ```
@@ -97,7 +97,7 @@ compiler support.
 ```yaml
      # Installs the stable toolchain which preceded the most recent one by
      # the specified number of minor versions.
-  - uses: IronCoreLabs/rust-toolchain@master
+  - uses: dtolnay/rust-toolchain@master
     with:
       toolchain: stable minus 8 releases
 ```