Skip to content

Commit

Permalink
core: improve add workflow dispatch to workflows (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiroaisen authored Jul 22, 2024
2 parents b256d9a + 966548c commit cadf24c
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 22 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/cargo-build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: backend-build

on:

workflow_dispatch:

push:
paths:
- "rs/**"
Expand Down Expand Up @@ -50,7 +53,7 @@ jobs:
key: ${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }}
restore-keys: |
${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }}
${{ runner.os }}-build-"
${{ runner.os }}-build-
# - name: Local cargo cache
# id: build-cargo-cache
Expand All @@ -59,5 +62,6 @@ jobs:
# path: ./target/
# key: build-cargo-target

# we build in release mode to be able to use the cache from this run within the release job
- name: Cargo Build
run: cargo build
run: cargo build --release
5 changes: 4 additions & 1 deletion .github/workflows/cargo-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: backend-integration-tests

on:

workflow_dispatch:

push:
paths:
- "rs/**"
Expand Down Expand Up @@ -51,7 +54,7 @@ jobs:
key: ${{ runner.os }}-integration-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }}
restore-keys: |
${{ runner.os }}-integration-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }}
${{ runner.os }}-integration-"
${{ runner.os }}-integration-
# - name: Local cargo cache
# id: integration-tests-cargo-cache
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/cargo-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: backend-unit-tests

on:

workflow_dispatch:

push:
paths:
- "rs/**"
Expand Down Expand Up @@ -52,7 +55,7 @@ jobs:
key: ${{ runner.os }}-unit-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }}
restore-keys: |
${{ runner.os }}-unit-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }}
${{ runner.os }}-unit-"
${{ runner.os }}-unit-
# - name: Local cargo cache
# id: unit-tests-cargo-cache
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/front-admin-build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: front-admin-build

on:

workflow_dispatch:

push:
paths:
- "defs/**"
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/front-admin-typecheck.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: front-admin-typecheck

on:

workflow_dispatch:

push:
paths:
- "defs/**"
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/front-server-build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: front-server-build

on:

workflow_dispatch:

push:
paths:
- "defs/**"
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/front-server-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: front-server-unit-tests

on:

workflow_dispatch:

push:
paths:
- "defs/**"
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/front-studio-build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: front-studio-build

on:

workflow_dispatch:

push:
paths:
- "defs/**"
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/front-studio-typecheck.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: front-studio-typecheck

on:

workflow_dispatch:

push:
paths:
- "defs/**"
Expand Down
40 changes: 22 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,44 @@ jobs:

release:

runs-on: self-hosted-release
# runs-on: self-hosted-release
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:

- uses: actions/checkout@v3
# - uses: Swatinem/rust-cache@v2
# with:
# cache-all-crates: true
# shared-key: release

- name: Local cargo cache
id: release-cargo-cache
uses: MasterworksIO/[email protected]
# cache-all-crates: true
# shared-key: release

# - name: Local cargo cache
# id: release-cargo-cache
# uses: MasterworksIO/[email protected]
# with:
# path: ./target/
# key: release-cargo-target

- uses: actions/checkout@v4

- uses: actions/cache@v4
with:
path: ./target/
key: release-cargo-target
path: |
./target
~/.cargo
key: ${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }}
restore-keys: |
${{ runner.os }}-build-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }}
${{ runner.os }}-build-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

# cache doesn't seem to work under tag branches, not even to recover from master branch saved cache
# - uses: actions/cache@v3
# with:
# path: ./target
# key: ${{ runner.os }}-cargo-build-release-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml', './rs') }}
# restore-keys: |
# ${{ runner.os }}-cargo-build-release-

- run: npm ci
working-directory: ./scripts

Expand Down

0 comments on commit cadf24c

Please sign in to comment.