Repository: racer-rust/racer (language: rust)

Issue:
Consider switching CI to GitHub Actions
Right now we have
- AppVeyor builds for testing `{x86_64, i686}-pc-windows-msvc` and
- Travis CI for `x86_64-unknown-linux-gnu`

which requires maintaining two config files and integrations; I also vaguely recall some problems when using AppVeyor, e.g. now it fails on missing rust-src in https://ci.appveyor.com/project/TedDriggs/racer-xr5g5/builds/36589888/job/fj30kkmy8hx7053c but Travis CI works without problems.

@kngwyu Would you accept a PR that sets up GitHub Actions for both of these platforms? We could also schedule nightly builds to catch breakage early, e.g. see https://github.com/rust-lang/rust-semverver/commit/80fac90ceabccf8a10f2eeab4cc59cd9a9de9a43 what's done in rust-semverver.


Discussion / hints:

Fix patch:
diff --git a/.appveyor.yml b/.appveyor.yml
deleted file mode 100644
index 75e5f86d..00000000
--- a/.appveyor.yml
+++ /dev/null
@@ -1,61 +0,0 @@
-# Based on https://github.com/japaric/rust-everywhere/blob/master/appveyor.yml
-environment:
-  RUSTUP_USE_HYPER: 1
-  CARGO_HTTP_CHECK_REVOKE: false
-  matrix:
-    # Stable channel
-    # - TARGET: i686-pc-windows-gnu
-    #   CHANNEL: stable
-    # - TARGET: i686-pc-windows-msvc
-    #   CHANNEL: stable
-    # - TARGET: x86_64-pc-windows-gnu
-    #   CHANNEL: stable
-    # - TARGET: x86_64-pc-windows-msvc
-    #   CHANNEL: stable
-    # Beta channel
-    # - TARGET: i686-pc-windows-gnu
-    #   CHANNEL: beta
-    # - TARGET: i686-pc-windows-msvc
-    #   CHANNEL: beta
-    # - TARGET: x86_64-pc-windows-gnu
-    #   CHANNEL: beta
-    # - TARGET: x86_64-pc-windows-msvc
-    #   CHANNEL: beta
-    # Nightly channel
-    # Now gnu build is disabled.
-    # See https://github.com/racer-rust/racer/pull/858 for the reason.
-    # - TARGET: i686-pc-windows-gnu
-    #   CHANNEL: nightly
-    - TARGET: i686-pc-windows-msvc
-      CHANNEL: nightly
-    # - TARGET: x86_64-pc-windows-gnu
-    #   CHANNEL: nightly
-    - TARGET: x86_64-pc-windows-msvc
-      CHANNEL: nightly
-
-# Install Rust and Cargo
-# (Based on from https://github.com/rust-lang/libc/blob/master/appveyor.yml)
-install:
-  - appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
-  - rustup-init.exe --default-host %TARGET% --default-toolchain %CHANNEL% -y
-  - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
-  # the rust-src is needed for tests that depend on the standard library
-  - rustup component add rust-src
-  - set RUST_SRC_PATH=C:\Users\appveyor\.rustup\toolchains\%CHANNEL%-%TARGET%\lib\rustlib\src\rust\library
-  - rustc -Vv
-  - cargo -V
-
-# 'cargo test' takes care of building for us, so disable Appveyor's build stage. This prevents
-# the "directory does not contain a project or solution file" error.
-# source: https://github.com/starkat99/appveyor-rust/blob/master/appveyor.yml#L113
-build: false
-
-# Equivalent to Travis' `script` phase
-# TODO modify this phase as you see fit
-test_script:
-  - cargo build --verbose --all
-  - cargo test --all
-
-cache:
-  - target
-  - C:\Users\appveyor\.cargo\registry
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 00000000..65884929
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,49 @@
+name: CI
+
+on:
+  pull_request:
+    types: [opened, synchronize, reopened]
+  push:
+    branches:
+      - master
+      - '*'
+  schedule:
+    - cron: '0 0 * * *' # Nightly at 00:00 UTC
+
+jobs:
+  build_and_test:
+    strategy:
+      fail-fast: false
+      matrix:
+        toolchain:
+          - x86_64-unknown-linux-gnu
+          - x86_64-apple-darwin
+          - x86_64-pc-windows-msvc
+          - i686-pc-windows-msvc
+        include:
+        - toolchain: x86_64-unknown-linux-gnu
+          builder: ubuntu-latest
+          os: linux
+        - toolchain: x86_64-apple-darwin
+          builder: macos-latest
+          os: macos
+        - toolchain: x86_64-pc-windows-msvc
+          builder: windows-latest
+          os: windows
+        - toolchain: i686-pc-windows-msvc
+          builder: windows-latest
+          os: windows
+
+    name: nightly - ${{ matrix.toolchain }}
+    runs-on: ${{ matrix.builder }}
+
+    steps:
+      - uses: actions/checkout@v2
+      - name: Use latest nightly on scheduled builds
+        if: github.event_name == 'schedule'
+        run: echo "nightly" > rust-toolchain
+      - run: rustup set default-host ${{ matrix.toolchain }}
+      - run: rustup component add rust-src
+      - run: rustc -vV
+      - run: cargo build --verbose
+      - run: cargo test


Test patch: