Update Rust crate log to v0.4.23 #1775
Workflow file for this run
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
name: "Continuous Integration" | |
on: [push, pull_request] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
# check and build | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
job: | |
- target: x86_64-unknown-linux-gnu | |
os: linux | |
runs-on: ubuntu-20.04 | |
- target: x86_64-pc-windows-gnu | |
os: windows | |
runs-on: windows-latest | |
- target: aarch64-apple-darwin | |
os: macos | |
runs-on: macos-latest | |
runs-on: ${{ matrix.job.runs-on }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mitoma/sver-actions/setup@v2 | |
with: | |
os: ${{ matrix.job.os }} | |
# ci phase | |
- name: check all | |
uses: mitoma/sver-actions/exec@v2 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
phase: check-${{ matrix.job.target }} | |
command: | | |
cargo fmt --all -- --check | |
cargo clippy -- -D warnings | |
cargo build | |
cargo test | |
cache_save_enable: false | |
cache_key: ${{ matrix.job.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
cache_restore-keys: ${{ matrix.job.target }}-cargo- | |
cache_path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
# build and upload artifact | |
build_artifact: | |
# run on branch [main] or tag [v*] | |
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) }} | |
needs: [build] | |
strategy: | |
fail-fast: false | |
matrix: | |
job: | |
- target: x86_64-unknown-linux-gnu | |
os: linux | |
runs-on: ubuntu-20.04 | |
- target: x86_64-pc-windows-gnu | |
os: windows | |
runs-on: windows-latest | |
- target: x86_64-apple-darwin | |
os: macos | |
runs-on: macos-latest | |
- target: aarch64-unknown-linux-gnu | |
os: linux | |
runs-on: ubuntu-20.04 | |
- target: aarch64-apple-darwin | |
os: macos | |
runs-on: macos-latest | |
runs-on: ${{ matrix.job.runs-on }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mitoma/sver-actions/setup@v2 | |
with: | |
os: ${{ matrix.job.os }} | |
# artifact phase | |
- name: build artifact | |
uses: mitoma/sver-actions/exec@v2 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
phase: artifact-${{ matrix.job.target }} | |
command: | | |
rustup target add "${{ matrix.job.target }}" | |
if [[ "${{ matrix.job.os }}" == linux && "${{ matrix.job.target }}" == aarch64-* ]]; then | |
sudo apt-get install gcc-aarch64-linux-gnu | |
fi | |
# debug build for cache optimization | |
cargo build --target=${{ matrix.job.target }} | |
# release build for create artifact | |
cargo build --release --target=${{ matrix.job.target }} | |
mkdir artifact | |
cd artifact | |
cp ../LICENSE . | |
cp ../README.md . | |
if [[ "${{ matrix.job.os }}" == windows ]]; then | |
cp ../target/${{ matrix.job.target }}/release/sver.exe . | |
else | |
cp ../target/${{ matrix.job.target }}/release/sver . | |
fi | |
cache_key: ${{ matrix.job.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
cache_restore-keys: ${{ matrix.job.target }}-cargo- | |
cache_path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
artifact_name: sver-${{ matrix.job.target }} | |
artifact_path: artifact | |
# release sver | |
release_sver: | |
# run on tag [v*] | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }} | |
needs: [build_artifact] | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mitoma/sver-actions/setup@v2 | |
- id: extract_tag | |
name: Extract tag name | |
run: echo "tag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT" | |
- name: create release | |
run: ./release.sh "${{ steps.extract_tag.outputs.tag }}" | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |