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

Manually-triggered releases, and reduce number of checks #84

Merged
merged 3 commits into from
Sep 29, 2023
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
24 changes: 13 additions & 11 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
name: Continuous Integration
on:
name: CI
on:
push:
branches:
- main
Comment on lines +4 to +5
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why only limit CI to branch main? (release stage is already limited)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not just limited to main :)

It also runs for PRs!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes the CI will run on PRs, but from what i can tell, it wont run on other branches in this repository

pull_request:
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

concurrency:
group: CI-${{ github.ref }}
group: CI-${{ github.ref }}
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -62,7 +65,7 @@ jobs:
key: ${{ runner.os }}-cargo-dev-${{ hashFiles('**/Cargo.lock') }}
- run: bash test/test_all.sh
- run: git diff --exit-code --quiet || exit 1

# things that use the cargo-test cache
test:
name: cargo test
Expand All @@ -79,11 +82,10 @@ jobs:
~/.cargo
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
- run: cargo test



# Things that don't need a cache
fmt:
name: rustfmt
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -92,15 +94,15 @@ jobs:
toolchain: nightly
- run: rustup component add rustfmt
- run: cargo fmt --all -- --check

release:
runs-on: ubuntu-latest
name: release
needs: [build, clippy, test, test-script, fmt]
if: github.ref == 'refs/heads/release'
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
hasezoey marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo publish
env:
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "dsync"
description = "Generate rust structs & query functions from diesel schema files."
version = "0.0.17-alpha"
version = "0.0.17-beta"
readme = "README.md"
repository = "https://github.com/Wulf/dsync"
license = "MIT OR Apache-2.0"
Expand Down