Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Rust version and resolve Clippy issues #160

Merged
merged 17 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Checks
on: [ pull_request ]
jobs:
tests:
name: Tests
uses: ./.github/workflows/test.yaml
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions-rust-lang/[email protected]
- uses: auguwu/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
permissions:
checks: write
formatting:
name: Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions-rust-lang/[email protected]
- uses: actions-rust-lang/[email protected]

15 changes: 0 additions & 15 deletions .github/workflows/clippy_check.yml

This file was deleted.

68 changes: 18 additions & 50 deletions .github/workflows/release.yml → .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,54 +1,27 @@
name: CI
on: [push]
name: Release
on:
push:
tags: [ 'v*' ]
jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all
tests:
uses: ./.github/workflows/test.yaml

cargo-release:
if: startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref, '-test')
needs: [test]
if: !endsWith(github.ref, '-test')
needs: [ tests ]
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- uses: actions/[email protected]
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
with:
toolchain: stable
override: true
- name: Install cargo release command
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-release
- name: Run cargo login
uses: actions-rs/cargo@v1
with:
command: login
args: ${{ secrets.CARGO_TOKEN }}
- name: Publish crates
uses: actions-rs/cargo@v1
with:
command: release
args: --no-dev-version --skip-push --skip-tag --no-confirm
- run: cargo install cargo-release
- run: cargo login ${{ secrets.CARGO_TOKEN }}
- run: cargo release --no-dev-version --skip-push --skip-tag --no-confirm

github-release:
if: startsWith(github.ref, 'refs/tags/')
needs: [test]
needs: [ tests ]
strategy:
matrix:
target:
Expand Down Expand Up @@ -108,14 +81,12 @@ jobs:
run: sudo apt update

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
with:
toolchain: stable
override: true
target: ${{ matrix.target }}

- name: Checkout
uses: actions/checkout@v2
- uses: actions/[email protected]

- name: Add experimental flags
if: ${{ endsWith(github.ref, '-test' )}}
Expand Down Expand Up @@ -147,10 +118,7 @@ jobs:

- name: Run build
if: ${{ !startsWith(matrix.target, 'aarch64-unknown-linux-') }}
uses: actions-rs/cargo@v1
with:
command: build
args: --bin=jrsonnet --release --target ${{ matrix.target }} ${{ env.EXPERIMENTAL_FLAGS }}
run: cargo build --bin=jrsonnet --release --target ${{ matrix.target }} ${{ env.EXPERIMENTAL_FLAGS }}

- name: Package
shell: bash
Expand All @@ -164,7 +132,7 @@ jobs:
run: shasum -a 256 ${{ matrix.name }} > ${{ matrix.name }}.sha256

- name: Publish
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2.0.4
with:
draft: true
files: "jrsonnet*"
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Test
on: [ workflow_call ]
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions-rust-lang/[email protected]
- run: cargo test --all
test-stable:
name: Test on stable
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Install the latest stable toolchain
uses: actions-rust-lang/[email protected]
with:
toolchain: stable
- run: cargo test --all

Loading