-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (64 loc) · 2.16 KB
/
pr.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: pr
on: [pull_request]
jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- run: echo "RUST_TOOLCHAIN=$(cat ./rust-toolchain)" >> $GITHUB_ENV
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
shared-key: debug-build
- name: Make test
run: make test
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- run: |
echo "RUST_TOOLCHAIN=$(cat ./rust-toolchain)" >> $GITHUB_ENV
echo "RUST_TOOLCHAIN_NIGHTLY=$(cat ./rust-toolchain-nightly)" >> $GITHUB_ENV
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN_NIGHTLY }}
components: rustfmt
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
shared-key: debug-build-nightly
- name: Make lint
run: make lint
semver:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Calculate next version
id: calc_version
uses: rymndhng/release-on-push-action@master
with:
bump_version_scheme: patch
tag_prefix: ""
dry_run: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set version
if: ${{ steps.calc_version.outputs.version }} != ""
run: |
sed -i "s/^version = \".*\"$/version = \"${{ steps.calc_version.outputs.version }}\"/" Cargo.toml
- name: Commit new version to main but don't push
if: ${{ steps.calc_version.outputs.version }} != ""
run: |
git config --global user.email "[email protected]"
git config --global user.name "MOIA Rust Maintainers"
git commit -am "Phantom release ${{ steps.calc_version.outputs.version }} [skip ci]"
- name: Check semver
uses: obi1kenobi/cargo-semver-checks-action@v2
with:
version-tag-prefix: ''