Skip to content

Commit

Permalink
ci: switch from local scripts to taiki-e/github-actions actions
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Nov 17, 2020
1 parent d242620 commit 51c9cec
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 101 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ jobs:
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v2
- name: Install Rust
run: ci/install-rust.sh ${{ matrix.rust }}
- uses: taiki-e/github-actions/install-rust@main
with:
toolchain: ${{ matrix.rust }}
- if: startsWith(matrix.rust, 'nightly')
run: cargo install cargo-hack
- run: rustup target add thumbv7m-none-eabi
Expand All @@ -54,8 +55,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust and Rustfmt
run: ci/install-component.sh rustfmt
- uses: taiki-e/github-actions/install-rust@main
with:
component: rustfmt
- name: Fetch latest release version of cargo-expand
run: |
mkdir -p .github/caching
Expand All @@ -76,24 +78,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust and Miri
run: ci/install-component.sh miri
- uses: taiki-e/github-actions/install-rust@main
with:
component: miri
- run: cargo miri test

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust and Clippy
run: ci/install-component.sh clippy
- uses: taiki-e/github-actions/install-rust@main
with:
component: clippy
- run: cargo clippy --all --all-features --all-targets

rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust and Rustfmt
run: ci/install-component.sh rustfmt
- uses: taiki-e/github-actions/install-rust@main
with:
component: rustfmt
- run: cargo fmt --all -- --check

rustdoc:
Expand All @@ -102,8 +107,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
run: ci/install-rust.sh
- run: taiki-e/github-actions/install-rust@main
- run: cargo doc --no-deps --all --all-features

shellcheck:
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
name: release
name: Release

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

defaults:
run:
shell: bash
- 'v*'

jobs:
create-release:
if: github.repository_owner == 'taiki-e'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: ci/create-release.sh
- run: taiki-e/github-actions/create-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47 changes: 0 additions & 47 deletions ci/create-release.sh

This file was deleted.

23 changes: 0 additions & 23 deletions ci/install-component.sh

This file was deleted.

10 changes: 0 additions & 10 deletions ci/install-rust.sh

This file was deleted.

7 changes: 5 additions & 2 deletions scripts/check-minimal-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ fi

# Parse subcommand.
subcmd="${1:-check}"
if [[ ! "${subcmd}" =~ check|test ]]; then
echo "error: invalid argument \`${1}\`"
if [[ ! "${subcmd}" =~ ^(check|test)$ ]]; then
echo "error: invalid argument: ${1}"
exit 1
elif [[ -n "${2:-}" ]]; then
echo "error: invalid argument: ${2}"
exit 1
fi

Expand Down

0 comments on commit 51c9cec

Please sign in to comment.