zed/.github/workflows/ci.yml

100 lines
2.5 KiB
YAML
Raw Normal View History

2021-04-03 00:43:30 +03:00
name: CI
on:
push:
branches:
- main
2021-05-18 01:47:42 +03:00
tags:
- "v*"
2021-04-03 00:43:30 +03:00
pull_request:
branches:
- "**"
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
2021-05-19 15:24:23 +03:00
RUST_BACKTRACE: 1
2021-04-03 00:43:30 +03:00
jobs:
2021-05-18 06:57:07 +03:00
tests:
name: Run tests
runs-on: self-hosted
env:
RUSTFLAGS: -D warnings
2021-05-18 06:57:07 +03:00
steps:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-apple-darwin
profile: minimal
2021-04-03 00:43:30 +03:00
2021-05-18 06:57:07 +03:00
- name: Checkout repo
uses: actions/checkout@v2
2021-05-18 07:46:33 +03:00
with:
clean: false
- name: Download rust-analyzer
run: |
script/download-rust-analyzer
echo "$PWD/vendor/bin" >> $GITHUB_PATH
2021-05-18 06:57:07 +03:00
- name: Run tests
2021-09-16 03:56:08 +03:00
run: cargo test --workspace --no-fail-fast
2021-05-18 01:18:31 +03:00
bundle:
name: Bundle app
runs-on: self-hosted
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
2021-09-11 08:11:22 +03:00
APPLE_NOTARIZATION_USERNAME: ${{ secrets.APPLE_NOTARIZATION_USERNAME }}
APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
2021-05-18 01:18:31 +03:00
steps:
2021-05-18 03:07:39 +03:00
- name: Install Rust x86_64-apple-darwin target
2021-05-18 01:18:31 +03:00
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-apple-darwin
profile: minimal
2021-05-18 03:07:39 +03:00
- name: Install Rust aarch64-apple-darwin target
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: aarch64-apple-darwin
profile: minimal
- name: Checkout repo
uses: actions/checkout@v2
2021-05-18 07:46:33 +03:00
with:
clean: false
- name: Validate version
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: script/validate-version
- name: Download rust-analyzer
run: script/download-rust-analyzer
2021-05-18 01:18:31 +03:00
- name: Create app bundle
run: script/bundle
2021-05-18 01:18:31 +03:00
- name: Upload app bundle to workflow run if main branch
2021-05-18 01:18:31 +03:00
uses: actions/upload-artifact@v2
if: ${{ github.ref == 'refs/heads/main' }}
with:
2021-04-29 00:42:42 +03:00
name: Zed.dmg
path: target/release/Zed.dmg
2021-05-18 01:18:31 +03:00
2021-05-18 08:39:01 +03:00
- uses: softprops/action-gh-release@v1
name: Upload app bundle to release if release tag
2021-05-18 06:33:08 +03:00
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
2021-05-18 01:18:31 +03:00
with:
2021-05-18 08:39:01 +03:00
draft: true
files: target/release/Zed.dmg
2021-05-18 01:18:31 +03:00
overwrite: true
body: ""
2021-05-18 08:39:01 +03:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}