Skip to content

Commit 9b6f630

Browse files
authored
Merge pull request #1 from JuliaComputing/sf/add_ci
Add GHA-based CI
2 parents ee0e1eb + ef1d4a3 commit 9b6f630

File tree

4 files changed

+292
-148
lines changed

4 files changed

+292
-148
lines changed

.github/workflows/CI.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# This file gratefully stolen from https://github.com/FedericoPonzi/rust-ci/
2+
name: CI
3+
4+
on:
5+
pull_request:
6+
push:
7+
branches:
8+
- master
9+
tags:
10+
- 'v*.*.*'
11+
12+
jobs:
13+
style:
14+
name: Check Style
15+
runs-on: ubuntu-22.04
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v1
19+
20+
- name: Install rust
21+
uses: actions-rs/toolchain@v1
22+
with:
23+
toolchain: stable
24+
components: rustfmt
25+
profile: minimal
26+
override: true
27+
28+
- name: cargo fmt -- --check
29+
uses: actions-rs/cargo@v1
30+
with:
31+
command: fmt
32+
args: --all -- --check
33+
34+
35+
test:
36+
name: Test
37+
needs: [style]
38+
runs-on: ubuntu-22.04
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v1
42+
43+
- name: Install rust
44+
uses: actions-rs/toolchain@v1
45+
with:
46+
toolchain: stable
47+
profile: minimal
48+
override: true
49+
50+
- name: Build
51+
shell: bash
52+
run: "make"
53+
54+
- name: Test
55+
shell: bash
56+
run: "make test"
57+
58+
create-release:
59+
name: deploy
60+
needs: [test]
61+
if: startsWith(github.ref, 'refs/tags/')
62+
runs-on: ubuntu-22.04
63+
strategy:
64+
matrix:
65+
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 ]
66+
steps:
67+
- name: Checkout
68+
uses: actions/checkout@v1
69+
- name: Install rust
70+
uses: actions-rs/toolchain@v1
71+
with:
72+
toolchain: stable
73+
profile: minimal
74+
override: true
75+
target: ${{ matrix.target }}
76+
77+
- name: Build target
78+
uses: actions-rs/cargo@v1
79+
with:
80+
use-cross: true
81+
command: build
82+
args: --release --target ${{ matrix.target }}
83+
84+
- name: Package
85+
shell: bash
86+
run: |
87+
mv target/${{ matrix.target }}/release/authorized-keys-github authorized-keys-github-${{ matrix.target }}
88+
89+
- name: Publish
90+
uses: softprops/action-gh-release@v1
91+
# TODO: if any of the build step fails, the release should be deleted.
92+
with:
93+
files: 'authorized-keys-github-*'
94+
env:
95+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)