Skip to content

Commit 30da940

Browse files
authored
chore: streamline the workflow steps (#22)
* chore: streamline the workflow steps * chore: fix broken rebase * chore: improve sqlite url * chore: better worker naming in tests * chore: Set Changelog
1 parent b87c3bb commit 30da940

18 files changed

Lines changed: 1418 additions & 214 deletions

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @geofmureithi

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ body:
3333
label: Steps to reproduce
3434
description: Steps to reproduce the behavior
3535
placeholder: |
36-
1. Go to '...'
37-
2. Click on '....'
38-
3. Scroll down to '....'
39-
4. See error
36+
1. Setup with '....'
37+
2. Do '....'
38+
3. See error
4039
validations:
4140
required: true
4241

@@ -51,9 +50,12 @@ body:
5150
id: version
5251
attributes:
5352
label: Version
54-
description: What version of apalis-sqlite are you running?
53+
description: What version are you running?
5554
options:
56-
- 1.0.0-alpha.1
55+
- 0.7.x
56+
- 1.0.0-alpha.x
57+
- 1.0.0-beta.x
58+
- 1.0.0-rc.x
5759
- main branch
5860
- Other (specify in additional context)
5961
validations:

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ body:
5151
id: terms
5252
attributes:
5353
label: Code of Conduct
54-
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/apalis-dev/apalis-sqlite/blob/main/CODE_OF_CONDUCT.md)
54+
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/apalis-dev/apalis/blob/main/CODE_OF_CONDUCT.md)
5555
options:
5656
- label: I agree to follow this project's Code of Conduct
5757
required: true

.github/workflows/changelog.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: "Changelog"
2+
permissions:
3+
contents: read
4+
on:
5+
pull_request:
6+
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
# Enforces the update of a changelog file on every pull request
11+
changelog:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: dangoslen/changelog-enforcer@v3

.github/workflows/ci.yml

Lines changed: 25 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,23 @@ name: CI
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [main, develop]
66
pull_request:
7-
branches: [main]
87

98
env:
109
CARGO_TERM_COLOR: always
1110
RUST_BACKTRACE: 1
11+
DATABASE_URL: sqlite://./test.db
12+
SQLX_OFFLINE: true
1213

1314
jobs:
1415
test:
1516
name: Test Suite
1617
runs-on: ${{ matrix.os }}
18+
1719
strategy:
1820
matrix:
19-
os: [ubuntu-latest, macos-latest] # TODO: windows-latest
21+
os: [ubuntu-latest]
2022
rust: [stable, beta]
2123
include:
2224
- os: ubuntu-latest
@@ -42,6 +44,18 @@ jobs:
4244
${{ runner.os }}-cargo-${{ matrix.rust }}-
4345
${{ runner.os }}-cargo-
4446
47+
- name: Install cargo-binstall
48+
uses: cargo-bins/cargo-binstall@v1.16.2
49+
50+
- name: Install sqlx-cli
51+
run: cargo binstall sqlx-cli --locked --force
52+
53+
- name: Set up database
54+
run: sqlx database create
55+
56+
- name: Run migrations
57+
run: sqlx migrate run
58+
4559
- name: Run cargo test with all features
4660
run: cargo test --all-features --verbose -- --test-threads=1
4761

@@ -108,50 +122,18 @@ jobs:
108122
env:
109123
RUSTDOCFLAGS: "-Dwarnings"
110124

111-
security:
112-
name: Security Audit
113-
runs-on: ubuntu-latest
114-
steps:
115-
- name: Checkout sources
116-
uses: actions/checkout@v6
117-
118-
- name: Install Rust toolchain
119-
uses: dtolnay/rust-toolchain@stable
120-
121-
- name: Install cargo-audit
122-
run: cargo install cargo-audit
123-
124-
- name: Run cargo audit
125-
run: cargo audit
126-
127-
coverage:
128-
name: Code Coverage
125+
unused-deps:
126+
name: Unused Dependencies
129127
runs-on: ubuntu-latest
130-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
131128
steps:
132129
- name: Checkout sources
133130
uses: actions/checkout@v6
134131

135-
- name: Install Rust toolchain
136-
uses: dtolnay/rust-toolchain@stable
137-
138-
- name: Install cargo-tarpaulin
139-
run: cargo install cargo-tarpaulin
140-
141-
- name: Cache cargo registry
142-
uses: actions/cache@v4
143-
with:
144-
path: |
145-
~/.cargo/registry
146-
~/.cargo/git
147-
target
148-
key: ${{ runner.os }}-cargo-coverage-${{ hashFiles('**/Cargo.lock') }}
132+
- name: Install Rust nightly toolchain
133+
uses: dtolnay/rust-toolchain@nightly
149134

150-
- name: Generate code coverage
151-
run: cargo tarpaulin --all-features --verbose --workspace --timeout 120 --out xml
135+
- name: Install cargo-udeps
136+
uses: taiki-e/install-action@cargo-udeps
152137

153-
- name: Upload to codecov.io
154-
uses: codecov/codecov-action@v5
155-
with:
156-
file: cobertura.xml
157-
fail_ci_if_error: false
138+
- name: Check for unused dependencies
139+
run: cargo +nightly udeps --all-targets --all-features

.github/workflows/coverage.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
RUST_BACKTRACE: 1
12+
DATABASE_URL: sqlite://./test.db
13+
SQLX_OFFLINE: true
14+
15+
jobs:
16+
coverage:
17+
name: Code Coverage
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout sources
21+
uses: actions/checkout@v6
22+
23+
- name: Install Rust toolchain
24+
uses: dtolnay/rust-toolchain@stable
25+
26+
- name: Install cargo-tarpaulin
27+
run: cargo install cargo-tarpaulin
28+
29+
- name: Cache cargo registry
30+
uses: actions/cache@v4
31+
with:
32+
path: |
33+
~/.cargo/registry
34+
~/.cargo/git
35+
target
36+
key: ${{ runner.os }}-cargo-coverage-${{ hashFiles('**/Cargo.lock') }}
37+
38+
- name: Install cargo-binstall
39+
uses: cargo-bins/cargo-binstall@v1.16.2
40+
41+
- name: Install sqlx-cli
42+
run: cargo binstall sqlx-cli --locked --force
43+
44+
- name: Set up database
45+
run: sqlx database create
46+
47+
- name: Run migrations
48+
run: sqlx migrate run
49+
50+
- name: Generate code coverage
51+
run: cargo tarpaulin --all-features --verbose --workspace --timeout 120 --out xml -- --test-threads=1
52+
53+
- name: Upload to codecov.io
54+
uses: codecov/codecov-action@v5
55+
with:
56+
file: cobertura.xml
57+
fail_ci_if_error: false
58+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/docs.yml

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

.github/workflows/issues.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Issue assignment
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
jobs:
8+
auto-assign:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
steps:
13+
- name: "Auto-assign issue"
14+
uses: pozil/auto-assign-issue@v2
15+
with:
16+
assignees: geofmureithi
17+
numOfAssignee: 1
18+
allowSelfAssign: true

.github/workflows/release.yml

Lines changed: 3 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ env:
1515
CARGO_TERM_COLOR: always
1616

1717
jobs:
18+
test:
19+
uses: ./.github/workflows/ci.yaml
1820
validate:
1921
name: Validate Release
2022
runs-on: ubuntu-latest
@@ -55,22 +57,10 @@ jobs:
5557
exit 1
5658
fi
5759
58-
- name: Run tests
59-
run: cargo test --all-features
60-
61-
- name: Check format
62-
run: cargo fmt --all -- --check
63-
64-
- name: Run clippy
65-
run: cargo clippy --all-targets --all-features
66-
67-
- name: Build docs
68-
run: cargo doc --all-features --no-deps
69-
7060
publish:
7161
name: Publish to crates.io
7262
runs-on: ubuntu-latest
73-
needs: validate
63+
needs: [test, validate]
7464
environment: release
7565
steps:
7666
- name: Checkout sources
@@ -93,40 +83,3 @@ jobs:
9383

9484
- name: Publish to crates.io
9585
run: cargo publish
96-
97-
github-release:
98-
name: Create GitHub Release
99-
runs-on: ubuntu-latest
100-
needs: [validate, publish]
101-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
102-
steps:
103-
- name: Checkout sources
104-
uses: actions/checkout@v6
105-
106-
- name: Generate changelog
107-
id: changelog
108-
run: |
109-
if [[ -f CHANGELOG.md ]]; then
110-
# Extract changelog for this version
111-
VERSION="v${{ needs.validate.outputs.version }}"
112-
sed -n "/^## \[$VERSION\]/,/^## \[/p" CHANGELOG.md | sed '$d' > release_notes.md
113-
if [[ -s release_notes.md ]]; then
114-
echo "Found changelog entry for $VERSION"
115-
else
116-
echo "## Changes" > release_notes.md
117-
echo "See commit history for detailed changes." >> release_notes.md
118-
fi
119-
else
120-
echo "## Changes" > release_notes.md
121-
echo "See commit history for detailed changes." >> release_notes.md
122-
fi
123-
124-
- name: Create GitHub Release
125-
uses: softprops/action-gh-release@v2
126-
with:
127-
name: Release v${{ needs.validate.outputs.version }}
128-
body_path: release_notes.md
129-
draft: false
130-
prerelease: ${{ contains(needs.validate.outputs.version, 'alpha') || contains(needs.validate.outputs.version, 'beta') || contains(needs.validate.outputs.version, 'rc') }}
131-
env:
132-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/rust-security.yml

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

0 commit comments

Comments
 (0)