From 9ed379cbaaba2880f988ce6e3e4ee712785ec39c Mon Sep 17 00:00:00 2001
From: Yuki Okushi <huyuumi.dev@gmail.com>
Date: Sat, 10 Oct 2020 22:06:18 +0900
Subject: [PATCH] Serial Experiments GitHub Actions

BuildChannelsMacOS, SemverLinux, and SemverMacOS
---
 .github/workflows/main.yml | 135 +++++++++++++++++++++++++++++++++++++
 ci/build.sh                |   4 +-
 ci/semver.sh               |   2 +-
 3 files changed, 138 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 8cd86705..39fd0358 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -426,3 +426,138 @@ jobs:
           done
       - name: Execute run-docker.sh
         run: LIBC_CI=1 sh ./ci/run-docker.sh switch
+
+  build_channels_macos:
+    name: Build Channels macOS
+    runs-on: macos-10.15
+    env:
+      OS: macos
+    strategy:
+      fail-fast: false
+      max-parallel: 5
+      matrix:
+        toolchain: [
+          stable,
+          beta,
+          nightly,
+          1.13.0,
+          1.19.0,
+          1.24.0,
+          1.25.0,
+          1.30.0,
+        ]
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: Setup Rust toolchain
+        run: |
+          set -ex
+          rustup set profile minimal
+          rustup update --force ${{ matrix.toolchain }}
+          rustup default ${{ matrix.toolchain }}
+      - name: Query Rust and Cargo versions
+        run: |
+          set -ex
+          rustc -Vv
+          cargo -V
+          rustup -Vv
+          rustup show
+          which rustc
+          which cargo
+          which rustup
+      - name: Generate lockfile
+        run: |
+          set -ex
+          N=5
+          n=0
+          until [ $n -ge $N ]
+          do
+            if cargo generate-lockfile ; then
+              break
+            fi
+            n=$((n+1))
+            sleep 1
+          done
+      - name: Execute build.sh
+        run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh
+
+  semver_linux:
+    name: Semver Linux
+    runs-on: ubuntu-18.04
+    strategy:
+      fail-fast: false
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: Setup Rust toolchain
+        run: |
+          set -ex
+          rustup set profile minimal
+          rustup update --force nightly
+          rustup default nightly
+      - name: Query Rust and Cargo versions
+        run: |
+          set -ex
+          rustc -Vv
+          cargo -V
+          rustup -Vv
+          rustup show
+          which rustc
+          which cargo
+          which rustup
+      - name: Generate lockfile
+        run: |
+          set -ex
+          N=5
+          n=0
+          until [ $n -ge $N ]
+          do
+            if cargo generate-lockfile ; then
+              break
+            fi
+            n=$((n+1))
+            sleep 1
+          done
+      - name: Check breaking changes
+        run: sh ci/semver.sh linux
+
+
+  semver_macos:
+    name: Semver macOS
+    runs-on: macos-10.15
+    strategy:
+      fail-fast: false
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: Setup Rust toolchain
+        run: |
+          set -ex
+          rustup set profile minimal
+          rustup update --force nightly
+          rustup default nightly
+      - name: Query Rust and Cargo versions
+        run: |
+          set -ex
+          rustc -Vv
+          cargo -V
+          rustup -Vv
+          rustup show
+          which rustc
+          which cargo
+          which rustup
+      - name: Generate lockfile
+        run: |
+          set -ex
+          N=5
+          n=0
+          until [ $n -ge $N ]
+          do
+            if cargo generate-lockfile ; then
+              break
+            fi
+            n=$((n+1))
+            sleep 1
+          done
+      - name: Check breaking changes
+        run: sh ci/semver.sh macos
diff --git a/ci/build.sh b/ci/build.sh
index eb8fb360..9decfb75 100644
--- a/ci/build.sh
+++ b/ci/build.sh
@@ -180,7 +180,7 @@ case "${OS}" in
         fi
 
         ;;
-    osx*)
+    macos*)
         TARGETS="${RUST_OSX_TARGETS}"
         ;;
     *)
@@ -269,7 +269,7 @@ i386-apple-ios \
 i686-apple-darwin \
 "
 
-if [ "${RUST}" = "nightly" ] && [ "${OS}" = "osx" ]; then
+if [ "${RUST}" = "nightly" ] && [ "${OS}" = "macos" ]; then
     for TARGET in $RUST_OSX_NO_CORE_TARGETS; do
         if echo "$TARGET" | grep -q "$FILTER"; then
             test_target build "$TARGET" 1
diff --git a/ci/semver.sh b/ci/semver.sh
index 392f5206..a8b0b3c5 100644
--- a/ci/semver.sh
+++ b/ci/semver.sh
@@ -53,7 +53,7 @@ x86_64-fortanix-unknown-sgx \
 wasm32-unknown-unknown \
 "
     ;;
-    *osx*)
+    *macos*)
         TARGETS="\
 aarch64-apple-ios \
 x86_64-apple-darwin \
-- 
GitLab