Skip to content

Commit f93349f

Browse files
committed
Add CI.
1 parent 5303e8e commit f93349f

File tree

4 files changed

+138
-2
lines changed

4 files changed

+138
-2
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
### Description
2+
3+
<!--Fix #0000-->
4+
5+
This pull request consists of the following changes:
6+
7+
<!--please provide a list of changes included in this pull request.-->
8+
9+
### Checklist
10+
11+
- [ ] I have self-reviewed and tested this pull request.
12+
- [ ] I have added tests for my changes.
13+
- [ ] I have updated docs to reflect any new features / changes in this pull request.
14+
- [ ] I have added my changes to `CHANGELOG.md`.

.github/dependabot.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
9+
- package-ecosystem: "cargo"
10+
directory: "/"
11+
schedule:
12+
interval: "weekly"

.github/workflows/everything.yml

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
---
2+
name: Run Tests & Publishing
3+
4+
on: [push, pull_request]
5+
6+
jobs:
7+
lint:
8+
name: Lint Codebase
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout Project
12+
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Setup Rust
17+
uses: actions-rs/toolchain@v1
18+
with:
19+
toolchain: stable
20+
override: true
21+
components: rustfmt, clippy
22+
profile: minimal
23+
24+
- name: Restore Rust Cache
25+
uses: Swatinem/rust-cache@v1
26+
27+
- name: Run Lints
28+
if: github.event_name == 'push'
29+
uses: actions-rs/clippy-check@v1
30+
with:
31+
token: ${{ secrets.GITHUB_TOKEN }}
32+
args: --all-features
33+
34+
- name: Run Lints (WebAssembly)
35+
if: github.event_name == 'push'
36+
uses: actions-rs/clippy-check@v1
37+
with:
38+
token: ${{ secrets.GITHUB_TOKEN }}
39+
args: --all-features --target=wasm32-unknown-unknown
40+
41+
- name: Run Lints (PR)
42+
if: github.event_name == 'pull_request'
43+
run: cargo clippy --all-features
44+
45+
- name: Run Lints (PR)
46+
if: github.event_name == 'pull_request'
47+
run: cargo clippy --all-features --target=wasm32-unknown-unknown
48+
49+
test:
50+
name: Run Tests
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Checkout Project
54+
uses: actions/checkout@v3
55+
with:
56+
fetch-depth: 0
57+
58+
- name: Setup Rust
59+
uses: actions-rs/toolchain@v1
60+
with:
61+
toolchain: stable
62+
override: true
63+
components: rustfmt, clippy
64+
profile: minimal
65+
66+
- name: Restore Rust Cache
67+
uses: Swatinem/rust-cache@v1
68+
69+
- name: Run Tests
70+
run: cargo test --all-features
71+
72+
publish:
73+
name: Publish to crates.io
74+
runs-on: ubuntu-latest
75+
needs:
76+
- lint
77+
- test
78+
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
79+
steps:
80+
- name: Checkout Project
81+
uses: actions/checkout@v3
82+
with:
83+
fetch-depth: 0
84+
85+
- name: Setup Rust
86+
uses: actions-rs/toolchain@v1
87+
with:
88+
toolchain: stable
89+
override: true
90+
components: rustfmt, clippy
91+
profile: minimal
92+
93+
- name: Restore Rust Cache
94+
uses: Swatinem/rust-cache@v1
95+
96+
- name: Run cargo publish --dry-run
97+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
98+
uses: actions-rs/cargo@v1
99+
with:
100+
command: publish
101+
args: --dry-run
102+
env:
103+
RUSTFLAGS: "--cfg releasing"
104+
105+
- name: Run cargo publish
106+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
107+
uses: actions-rs/cargo@v1
108+
with:
109+
command: publish
110+
args: --token ${{ secrets.CRATES_IO_TOKEN }}
111+
env:
112+
RUSTFLAGS: "--cfg releasing"

CHANGELOG.md

-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,3 @@
33
### v0.1.0
44

55
- Copied existing implementation from Yew.
6-
- Added `Barrier`.
7-
- Added `RwLock`.

0 commit comments

Comments
 (0)