Skip to content

Commit

Permalink
Switch to GitHub workflows (#487)
Browse files Browse the repository at this point in the history
Fixes #485

And switches workflows to GitHub from Azure
  • Loading branch information
pinkforest authored Dec 12, 2023
1 parent 4d31282 commit 2d1fc07
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 59 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/cache-zigs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "Cache Zigs"

on:
workflow_dispatch:

jobs:

matrix:
name: Generate test matrix
runs-on: ubuntu-latest
outputs:
matrix-json: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v2
with:
repository: rinse-repeat/zig-gh-helper
path: zig-helper
- id: set-matrix
run: |
echo "ZIG_VERSION=${{ inputs.zig-version }}" | tee -a $GITHUB_ENV
content=`cat ./zig-helper/matrix.json`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
echo "::set-output name=matrix::$content"
install-zig:
needs: [matrix]
uses: rinse-repeat/zig-gh-helper/.github/workflows/zig_install.yml@main
with:
os: ${{ matrix.os }}
use-cache: true
ext-cache: AAB
zig-version: 0.9.1
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.matrix.outputs.matrix-json) }}

50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI

on:
push:
branches: [ '**' ]
pull_request:
branches: [ '**' ]

env:
CARGO_TERM_COLOR: 'always'
RUSTFLAGS: '-D warnings'

jobs:
test-stable:
name: Test stable
runs-on: ${{ matrix.runs-on }}
strategy:
matrix:
include:
# Linux
- runs-on: ubuntu-latest
# Windows
- runs-on: windows-latest
# MacOS
- runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo test -- --skip args::args_tests::update_config_test_color_choice::case_4 --skip test_package

# TODO: Address clippy
# clippy:
# name: Check that clippy is happy
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: dtolnay/rust-toolchain@1.73.0
# with:
# components: clippy
# - run: cargo clippy --target x86_64-unknown-linux-gnu --all-features

rustfmt:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
55 changes: 55 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "Cargo-geiger Release Builder"

on:
workflow_dispatch:
inputs:
tag:
description: 'Release tag'
required: true
type: string

jobs:

matrix:
name: Generate Matrix
runs-on: ubuntu-latest
outputs:
matrix-json: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v2
with:
path: release-repo
- id: set-matrix
run: |
content=`cat ./release-repo/matrix.json`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
echo "::set-output name=matrix::$content"
build:
needs: [matrix]
uses: rinse-repeat/auditable-builder/.github/workflows/rust-builder.yml@main
with:
repository: geiger-rs/cargo-geiger
rust-target: ${{ matrix.rust-target }}
os: ${{ matrix.os }}
rust: ${{ matrix.rust }}
use-features: ${{ matrix.use-features }}
use-cache: true
use-locked: true
serial: AAB
zig-version: 0.9.1
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.matrix.outputs.matrix-json) }}

release:
needs: [build]
uses: rinse-repeat/auditable-builder/.github/workflows/release-builder.yml@main
with:
repository: geiger-rs/cargo-geiger
tag: ${{ github.event.inputs.tag }}

59 changes: 0 additions & 59 deletions azure-pipelines.yml

This file was deleted.

11 changes: 11 additions & 0 deletions matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{"rust-target": "x86_64-pc-windows-msvc" , "os": "windows-latest" , "rust": "stable"},
{"rust-target": "i686-pc-windows-msvc" , "os": "windows-latest" , "rust": "stable"},
{"rust-target": "aarch64-pc-windows-msvc" , "os": "windows-latest" , "rust": "stable"},
{"rust-target": "armv7-unknown-linux-gnueabihf" , "os": "ubuntu-latest" , "rust": "stable", "use-features": "vendored-openssl"},
{"rust-target": "arm-unknown-linux-gnueabihf" , "os": "ubuntu-latest" , "rust": "stable", "use-features": "vendored-openssl"},
{"rust-target": "x86_64-unknown-linux-gnu" , "os": "ubuntu-latest" , "rust": "stable"},
{"rust-target": "aarch64-unknown-linux-gnu" , "os": "ubuntu-latest" , "rust": "stable", "use-features": "vendored-openssl"},
{"rust-target": "x86_64-apple-darwin" , "os": "macos-latest" , "rust": "stable"},
{"rust-target": "aarch64-apple-darwin" , "os": "macos-latest" , "rust": "stable", "use-features": "vendored-openssl"}
]

0 comments on commit 2d1fc07

Please sign in to comment.