summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGregory <chmln@users.noreply.github.com>2020-07-03 11:59:06 -0400
committerGitHub <noreply@github.com>2020-07-03 11:59:06 -0400
commitd3aa277628b8b91e794aa7bc8ee86dee92863ab2 (patch)
treef88f5a78e52191f50363806778e4ba3ae19fbfa8
parentba560244bb863aa63c382c0d184af24a3379d9f8 (diff)
parentcca3c8577caba0856bcc262ac8b13afd2ce150c6 (diff)
Merge pull request #89 from chmln/ci
New CI
-rw-r--r--.github/workflows/publish.yml59
-rw-r--r--.github/workflows/test.yml39
-rw-r--r--azure-pipelines.yml37
3 files changed, 98 insertions, 37 deletions
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
new file mode 100644
index 0000000..9d5d8fc
--- /dev/null
+++ b/.github/workflows/publish.yml
@@ -0,0 +1,59 @@
+name: Publish
+
+on:
+ push:
+ tags:
+ - '*'
+
+jobs:
+ publish:
+ name: ${{ matrix.target }}
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ include:
+ - os: ubuntu-latest
+ target: x86_64-unknown-linux-gnu
+
+ - os: ubuntu-latest
+ target: x86_64-unknown-linux-musl
+
+ - os: windows-latest
+ target: x86_64-pc-windows-msvc
+
+ - os: macos-latest
+ target: x86_64-apple-darwin
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 1
+
+ - name: Set the version
+ id: version
+ run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
+
+ - name: Install Rust
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: stable
+ profile: minimal
+ override: true
+ target: ${{ matrix.target }}
+
+
+ - name: Build
+ run: cargo build --release --locked
+
+ - name: Strip binary
+ if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
+ run: strip target/release/sd
+
+ - name: Upload binaries to release
+ uses: svenstaro/upload-release-action@v1-release
+ with:
+ repo_token: ${{ secrets.GITHUB_TOKEN }}
+ file: target/release/sd
+ asset_name: sd-${{ steps.version.outputs.VERSION }}-${{ matrix.target }}
+ tag: ${{ github.ref }}
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..0fe9a2f
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,39 @@
+name: Test
+
+on: [pull_request]
+
+jobs:
+ test:
+ name: ${{ matrix.target }}
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ include:
+ - os: ubuntu-latest
+ target: x86_64-unknown-linux-gnu
+
+ - os: ubuntu-latest
+ target: x86_64-unknown-linux-musl
+
+ - os: windows-latest
+ target: x86_64-pc-windows-msvc
+
+ - os: macos-latest
+ target: x86_64-apple-darwin
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 1
+
+ - name: Install Rust
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: stable
+ profile: minimal
+ override: true
+ target: ${{ matrix.target }}
+
+ - name: Test
+ run: cargo test
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
deleted file mode 100644
index d51b8c7..0000000
--- a/azure-pipelines.yml
+++ /dev/null
@@ -1,37 +0,0 @@
-trigger:
- branches:
- include: ['*']
- tags:
- include: ['*']
-
-resources:
- repositories:
- - repository: rust_pipelines
- type: github
- name: xoac/rust-azure-pipelines
- ref: refs/heads/master
- endpoint: githubConnection
-stages:
-- stage: test
- displayName: "Test"
- jobs:
- - template: ci/jobs/cargo-test.yaml@rust_pipelines
-
- #condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
-- stage: build
- displayName: "Build"
- jobs:
- - template: ci/scenarios/builds.yml@rust_pipelines
- dependsOn:
- - test
-
-# Deploy binaries to github only if tags start with `v` for example `v0.1.5`
-- stage: deploy
- displayName: "Deploy"
- dependsOn:
- - build
- jobs:
- - template: ci/scenarios/github/release.yml@rust_pipelines
- parameters:
- job_condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
- gitHubConnection: githubConnection