Skip to content

Commit cd93f6d

Browse files
authored
Merge pull request #54 from rust-embedded-community/update-actions
Update and simplify workflows
2 parents af21186 + 3965028 commit cd93f6d

File tree

4 files changed

+33
-77
lines changed

4 files changed

+33
-77
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build
1+
name: Cargo
22

33
on: [push, pull_request]
44

@@ -9,38 +9,23 @@ jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: Checkout Code
13-
uses: actions/checkout@v3
14-
with:
15-
submodules: true
12+
- uses: actions/checkout@v4
13+
- run: cargo build --verbose
1614

17-
- name: Install Rust
18-
uses: actions-rs/toolchain@v1
19-
with:
20-
profile: minimal
21-
toolchain: stable
22-
override: true
23-
24-
- name: Build Code
25-
run: cargo build --verbose
26-
27-
- name: Test Code
28-
run: cargo test --verbose
15+
test:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- run: cargo test --verbose
2920

30-
- name: Get Branch Name
31-
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
32-
id: branch_name
33-
run: |
34-
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
21+
format-check:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- run: cargo fmt --check
3526

36-
- name: Create Release
37-
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
38-
id: create_release
39-
uses: actions/create-release@v1
40-
env:
41-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
with:
43-
tag_name: ${{ github.ref }}
44-
release_name: Release ${{ steps.branch_name.outputs.SOURCE_TAG }}
45-
draft: false
46-
prerelease: false
27+
clippy-check:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
- run: cargo clippy

.github/workflows/clippy.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/format.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
release-create:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: ncipollo/release-action@v1

0 commit comments

Comments
 (0)