-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from JuliaComputing/sf/add_ci
Add GHA-based CI
- Loading branch information
Showing
4 changed files
with
292 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# This file gratefully stolen from https://github.com/FedericoPonzi/rust-ci/ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
style: | ||
name: Check Style | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: Install rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: rustfmt | ||
profile: minimal | ||
override: true | ||
|
||
- name: cargo fmt -- --check | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
|
||
test: | ||
name: Test | ||
needs: [style] | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: Install rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
|
||
- name: Build | ||
shell: bash | ||
run: "make" | ||
|
||
- name: Test | ||
shell: bash | ||
run: "make test" | ||
|
||
create-release: | ||
name: deploy | ||
needs: [test] | ||
if: startsWith(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
target: [ aarch64-unknown-linux-gnu, armv7-unknown-linux-gnueabihf, i686-unknown-linux-gnu, i686-unknown-linux-musl, powerpc64-unknown-linux-gnu, powerpc64le-unknown-linux-gnu, arm-unknown-linux-gnueabi, x86_64-unknown-linux-gnu, x86_64-unknown-linux-musl ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Install rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
target: ${{ matrix.target }} | ||
|
||
- name: Build target | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
use-cross: true | ||
command: build | ||
args: --release --target ${{ matrix.target }} | ||
|
||
- name: Package | ||
shell: bash | ||
run: | | ||
mv target/${{ matrix.target }}/release/authorized-keys-github authorized-keys-github-${{ matrix.target }} | ||
- name: Publish | ||
uses: softprops/action-gh-release@v1 | ||
# TODO: if any of the build step fails, the release should be deleted. | ||
with: | ||
files: 'authorized-keys-github-*' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Oops, something went wrong.