2021-04-02 21:43:30 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2021-05-17 22:47:42 +00:00
|
|
|
tags:
|
|
|
|
- "v*"
|
2021-04-02 21:43:30 +00:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- "**"
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
tests:
|
2021-05-17 22:18:31 +00:00
|
|
|
name: Run tests
|
2021-04-15 03:56:24 +00:00
|
|
|
runs-on: self-hosted
|
2021-04-02 21:43:30 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
# Work around https://github.com/actions/cache/issues/403.
|
|
|
|
- name: Use GNU tar
|
|
|
|
run: |
|
|
|
|
echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Cache artifacts
|
|
|
|
id: cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/registry
|
|
|
|
~/.cargo/git
|
2021-05-04 23:46:44 +00:00
|
|
|
~/.rustup
|
2021-04-02 21:43:30 +00:00
|
|
|
target
|
|
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
|
|
|
|
|
2021-04-28 21:04:22 +00:00
|
|
|
- name: Install Rust
|
2021-05-04 23:46:44 +00:00
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
2021-04-02 21:43:30 +00:00
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
2021-05-04 23:34:03 +00:00
|
|
|
target: x86_64-apple-darwin
|
2021-04-02 21:43:30 +00:00
|
|
|
profile: minimal
|
|
|
|
|
|
|
|
- name: Run tests
|
2021-04-28 19:58:14 +00:00
|
|
|
run: cargo test --no-fail-fast
|
2021-04-28 21:04:22 +00:00
|
|
|
|
2021-05-17 22:18:31 +00:00
|
|
|
bundle:
|
|
|
|
name: Bundle app
|
|
|
|
runs-on: self-hosted
|
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
# Work around https://github.com/actions/cache/issues/403.
|
|
|
|
- name: Use GNU tar
|
|
|
|
run: |
|
|
|
|
echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Cache artifacts
|
|
|
|
id: cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/registry
|
|
|
|
~/.cargo/git
|
|
|
|
~/.rustup
|
|
|
|
target
|
|
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
|
|
|
|
|
|
|
|
- name: Install Rust
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
target: x86_64-apple-darwin
|
|
|
|
profile: minimal
|
|
|
|
|
|
|
|
- name: Create app bundle
|
2021-04-28 21:04:22 +00:00
|
|
|
run: script/bundle
|
2021-05-17 22:18:31 +00:00
|
|
|
|
|
|
|
- name: Upload app bundle to workflow run
|
|
|
|
uses: actions/upload-artifact@v2
|
2021-04-28 21:04:22 +00:00
|
|
|
with:
|
2021-04-28 21:42:42 +00:00
|
|
|
name: Zed.dmg
|
2021-05-04 23:18:14 +00:00
|
|
|
path: target/release/Zed.dmg
|
2021-05-17 22:18:31 +00:00
|
|
|
|
|
|
|
- uses: svenstaro/upload-release-action@v2
|
|
|
|
name: Upload app bundle to release
|
|
|
|
if: ${{ startsWith(github.github.ref, 'refs/tags/v') }}
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
file: target/release/Zed.dmg
|
|
|
|
asset_name: Zed.dmg
|
|
|
|
tag: ${{ github.ref }}
|
|
|
|
overwrite: true
|
|
|
|
body: ""
|