Skip to content

Commit

Permalink
Workflow Updates (#367)
Browse files Browse the repository at this point in the history
* update version of the checkout and cache actions that we use.

* fix line spacing

* add dummy jobs to poem workflows so we stop getting those "Run failed at startup" emails

* ci: move away from the actions-rs/cargo action, we can just run cargo directly
  • Loading branch information
AnthonyMichaelTDM authored May 9, 2024
1 parent ba13b45 commit d9dd34d
Show file tree
Hide file tree
Showing 6 changed files with 304 additions and 312 deletions.
102 changes: 48 additions & 54 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,85 +10,79 @@ env:
CARGO_TERM_COLOR: always

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

jobs:
# development-lint:
# name: Clippy with debug-assertions
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3.6.0
# - uses: rui314/setup-mold@v1
# - run: rustup install stable
# - run: rustup update
# - run: rustup component add clippy
# - uses: actions/cache@v3.3.1
# with:
# path: |
# ./.cargo/.build
# ./target
# ~/.cargo
# key: ${{ runner.os }}-cargo-dev-${{ hashFiles('**/Cargo.lock') }}
# - name: Clippy
# uses: actions-rs/[email protected]
# with:
# command: clippy
# args: -- -D warnings -C debug-assertions=y
# development-lint:
# name: Clippy with debug-assertions
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4.1.4
# - uses: rui314/setup-mold@v1
# - run: rustup install stable
# - run: rustup update
# - run: rustup component add clippy
# - uses: actions/cache@v4.0.2
# with:
# path: |
# ./.cargo/.build
# ./target
# ~/.cargo
# key: ${{ runner.os }}-cargo-dev-${{ hashFiles('**/Cargo.lock') }}
# - name: Clippy
# uses: actions-rs/[email protected]
# with:
# command: clippy
# args: -- -D warnings -C debug-assertions=y

# production-lint:
# name: Clippy without debug-assertions
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3.6.0
# - uses: rui314/setup-mold@v1
# - run: rustup install stable
# - run: rustup update
# - run: rustup component add clippy
# - uses: actions/cache@v3.3.1
# with:
# path: |
# ./.cargo/.build
# ./target
# ~/.cargo
# key: ${{ runner.os }}-cargo-prod-${{ hashFiles('**/Cargo.lock') }}
# - name: Clippy
# uses: actions-rs/[email protected]
# with:
# command: clippy
# args: -- -D warnings -C debug-assertions=n
# production-lint:
# name: Clippy without debug-assertions
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4.1.4
# - uses: rui314/setup-mold@v1
# - run: rustup install stable
# - run: rustup update
# - run: rustup component add clippy
# - uses: actions/cache@v4.0.2
# with:
# path: |
# ./.cargo/.build
# ./target
# ~/.cargo
# key: ${{ runner.os }}-cargo-prod-${{ hashFiles('**/Cargo.lock') }}
# - name: Clippy
# uses: actions-rs/[email protected]
# with:
# command: clippy
# args: -- -D warnings -C debug-assertions=n

# things that use the cargo-test cache
test:
name: Test Suite and Initialize profile.test Cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.4
- uses: rui314/setup-mold@v1
- run: rustup install stable
- run: rustup update
- uses: actions/cache@v3.3.1
- uses: actions/cache@v4.0.2
with:
path: |
./.cargo/.build
./target
~/.cargo
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/[email protected]
with:
command: test

- run: cargo test --all

# Things that don't need a cache
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.4
- run: rustup install stable
- run: rustup update
- run: rustup component add rustfmt
- uses: actions-rs/[email protected]
with:
command: fmt
args: --all -- --check
- run: cargo fmt --all -- --check
48 changes: 21 additions & 27 deletions .github/workflows/CLI-ActixPostgres-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ name: CLI Continuous Integration (Compilation tests for variations of Actix + Po
on:
workflow_dispatch:
push:
branches:
branches:
- "main"
paths:
paths:
- "**.rs"
- "Cargo.lock"
- "Cargo.toml"
pull_request:
paths:
paths:
- "**.rs"
- "Cargo.lock"
- "Cargo.toml"
env:
CARGO_TERM_COLOR: always
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse

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

jobs:
Expand All @@ -27,21 +27,18 @@ jobs:
name: Actix w/ Postgres and no plugins
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.4
- uses: rui314/setup-mold@v1
- run: rustup install stable
- run: rustup update
- uses: actions/cache@v3.3.1
- uses: actions/cache@v4.0.2
with:
path: |
.cargo/.build
key: ${{ runner.os }}-cargo-cli-AP-${{ hashFiles('**/Cargo.lock') }}
- run: git config --global user.name test
- run: git config --global user.email [email protected]
- uses: actions-rs/[email protected]
with:
command: run
args: --bin create-rust-app -- create -c -d postgres -b actix-web test-project
- run: cargo run --bin create-rust-app -- create -c -d postgres -b actix-web test-project
- name: test test-project
working-directory: ./test-project
run: |
Expand All @@ -55,21 +52,18 @@ jobs:
name: Actix w/ Postgres and all valid plugins
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.6.0
- uses: actions/checkout@v4.1.4
- uses: rui314/setup-mold@v1
- run: rustup install stable
- run: rustup update
- uses: actions/cache@v3.3.1
- uses: actions/cache@v4.0.2
with:
path: |
.cargo/.build
key: ${{ runner.os }}-cargo-cli-AP-all-${{ hashFiles('**/Cargo.lock') }}
- run: git config --global user.name test
- run: git config --global user.email [email protected]
- uses: actions-rs/[email protected]
with:
command: run
args: --bin create-rust-app -- create -c -d postgres -b actix-web --plugins=auth,container,graphql,storage,utoipa test-project
- run: cargo run --bin create-rust-app -- create -c -d postgres -b actix-web --plugins=auth,container,graphql,storage,utoipa test-project
- name: test test-project
working-directory: ./test-project
run: |
Expand All @@ -83,11 +77,11 @@ jobs:
# name: Actix w/ Postgres and the container plugin
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3.6.0
# - uses: actions/checkout@v4.1.4
# - uses: rui314/setup-mold@v1
# - run: rustup install stable
# - run: rustup update
# - uses: actions/cache@v3.3.1
# - uses: actions/cache@v4.0.2
# with:
# path: |
# **/.cargo/.build
Expand All @@ -106,11 +100,11 @@ jobs:
# name: Actix w/ Postgres and the auth plugin
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3.6.0
# - uses: actions/checkout@v4.1.4
# - uses: rui314/setup-mold@v1
# - run: rustup install stable
# - run: rustup update
# - uses: actions/cache@v3.3.1
# - uses: actions/cache@v4.0.2
# with:
# path: |
# **/.cargo/.build
Expand All @@ -129,11 +123,11 @@ jobs:
# name: Actix w/ Postgres and the storage plugin
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3.6.0
# - uses: actions/checkout@v4.1.4
# - uses: rui314/setup-mold@v1
# - run: rustup install stable
# - run: rustup update
# - uses: actions/cache@v3.3.1
# - uses: actions/cache@v4.0.2
# with:
# path: |
# **/.cargo/.build
Expand All @@ -152,11 +146,11 @@ jobs:
# name: Actix w/ Postgres and the graphql plugin
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3.6.0
# - uses: actions/checkout@v4.1.4
# - uses: rui314/setup-mold@v1
# - run: rustup install stable
# - run: rustup update
# - uses: actions/cache@v3.3.1
# - uses: actions/cache@v4.0.2
# with:
# path: |
# **/.cargo/.build
Expand All @@ -175,11 +169,11 @@ jobs:
# name: Actix w/ Postgres and the utoipa plugin
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3.6.0
# - uses: actions/checkout@v4.1.4
# - uses: rui314/setup-mold@v1
# - run: rustup install stable
# - run: rustup update
# - uses: actions/cache@v3.3.1
# - uses: actions/cache@v4.0.2
# with:
# path: |
# **/.cargo/.build
Expand Down
Loading

0 comments on commit d9dd34d

Please sign in to comment.