Skip to content

Commit

Permalink
ci: add build step, use release, fix config (denoland#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju committed Jun 2, 2020
1 parent 8c9d597 commit ce4adf6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
27 changes: 15 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
rust:
name: rust-${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
timeout-minutes: 30
strategy:
matrix:
os: [macOS-latest, ubuntu-16.04, windows-2019]
Expand All @@ -29,39 +29,42 @@ jobs:
uses: actions/cache@v2
with:
path: target/
key: ${{ matrix.config.os }}-${{ hashFiles('Cargo.lock') }}
key: ${{ matrix.os }}-${{ hashFiles('Cargo.lock') }}

- name: Environment
run: |
echo ::set-env name=GH_ACTIONS::1
echo ::set-env name=RUST_BACKTRACE::full
- name: lint
run: cargo clippy --all-targets --locked -- -D clippy::all

- name: format
- name: Format
run: rustfmt --check src/main.rs

- name: test
run: cargo test --locked --all-targets
- name: Build
run: cargo build --locked --release --all-targets

- name: Test
run: cargo test --locked --release --all-targets

- name: Lint
run: cargo clippy --all-targets --release --locked -- -D clippy::all

- name: Pre-release (linux)
if: |
startsWith(matrix.config.os, 'ubuntu')
startsWith(matrix.os, 'ubuntu')
run: |
cd target/release
zip -r deno_lint-x86_64-unknown-linux-gnu.zip deno_lint
- name: Pre-release (mac)
if: |
startsWith(matrix.config.os, 'macOS')
startsWith(matrix.os, 'macOS')
run: |
cd target/release
zip -r deno_lint-x86_64-apple-darwin.zip deno_lint
- name: Pre-release (windows)
if: |
startsWith(matrix.config.os, 'windows')
startsWith(matrix.os, 'windows')
run: |
Compress-Archive -CompressionLevel Optimal -Force -Path target/release/deno_lint.exe -DestinationPath target/release/deno_lint-x86_64-pc-windows-msvc.zip
Expand All @@ -81,7 +84,7 @@ jobs:

- name: Publish
if: |
startsWith(matrix.config.os, 'ubuntu') &&
startsWith(matrix.os, 'ubuntu') &&
github.repository == 'denoland/deno_lint' &&
startsWith(github.ref, 'refs/tags/')
env:
Expand Down
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Copyright 2020 the Deno authors. All rights reserved. MIT license.
#![deny(warnings)]

#[macro_use]
extern crate lazy_static;

Expand Down

0 comments on commit ce4adf6

Please sign in to comment.