From 966548c5308ddeea768daaade23282c4fbeb6fdb Mon Sep 17 00:00:00 2001 From: ramiroaisen <52116153+ramiroaisen@users.noreply.github.com> Date: Mon, 22 Jul 2024 10:42:30 -0300 Subject: [PATCH] core: improve add workflow dispatch to workflows --- .github/workflows/cargo-build.yml | 8 +++- .github/workflows/cargo-integration-tests.yml | 5 ++- .github/workflows/cargo-unit-tests.yml | 5 ++- .github/workflows/front-admin-build.yml | 3 ++ .github/workflows/front-admin-typecheck.yml | 3 ++ .github/workflows/front-server-build.yml | 3 ++ .github/workflows/front-server-unit-tests.yml | 3 ++ .github/workflows/front-studio-build.yml | 3 ++ .github/workflows/front-studio-typecheck.yml | 3 ++ .github/workflows/release.yml | 40 ++++++++++--------- 10 files changed, 54 insertions(+), 22 deletions(-) diff --git a/.github/workflows/cargo-build.yml b/.github/workflows/cargo-build.yml index 775adb2d..0822401b 100644 --- a/.github/workflows/cargo-build.yml +++ b/.github/workflows/cargo-build.yml @@ -1,6 +1,9 @@ name: backend-build on: + + workflow_dispatch: + push: paths: - "rs/**" @@ -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 @@ -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 \ No newline at end of file + run: cargo build --release \ No newline at end of file diff --git a/.github/workflows/cargo-integration-tests.yml b/.github/workflows/cargo-integration-tests.yml index 6fd37fbe..9fb6a0d6 100644 --- a/.github/workflows/cargo-integration-tests.yml +++ b/.github/workflows/cargo-integration-tests.yml @@ -1,6 +1,9 @@ name: backend-integration-tests on: + + workflow_dispatch: + push: paths: - "rs/**" @@ -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 diff --git a/.github/workflows/cargo-unit-tests.yml b/.github/workflows/cargo-unit-tests.yml index 249c69f1..e9fed747 100644 --- a/.github/workflows/cargo-unit-tests.yml +++ b/.github/workflows/cargo-unit-tests.yml @@ -1,6 +1,9 @@ name: backend-unit-tests on: + + workflow_dispatch: + push: paths: - "rs/**" @@ -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 diff --git a/.github/workflows/front-admin-build.yml b/.github/workflows/front-admin-build.yml index fdd3ca6e..2904634c 100644 --- a/.github/workflows/front-admin-build.yml +++ b/.github/workflows/front-admin-build.yml @@ -1,6 +1,9 @@ name: front-admin-build on: + + workflow_dispatch: + push: paths: - "defs/**" diff --git a/.github/workflows/front-admin-typecheck.yml b/.github/workflows/front-admin-typecheck.yml index 993921c1..91d33967 100644 --- a/.github/workflows/front-admin-typecheck.yml +++ b/.github/workflows/front-admin-typecheck.yml @@ -1,6 +1,9 @@ name: front-admin-typecheck on: + + workflow_dispatch: + push: paths: - "defs/**" diff --git a/.github/workflows/front-server-build.yml b/.github/workflows/front-server-build.yml index a0319f21..e99aec43 100644 --- a/.github/workflows/front-server-build.yml +++ b/.github/workflows/front-server-build.yml @@ -1,6 +1,9 @@ name: front-server-build on: + + workflow_dispatch: + push: paths: - "defs/**" diff --git a/.github/workflows/front-server-unit-tests.yml b/.github/workflows/front-server-unit-tests.yml index abc934bd..9d2aee18 100644 --- a/.github/workflows/front-server-unit-tests.yml +++ b/.github/workflows/front-server-unit-tests.yml @@ -1,6 +1,9 @@ name: front-server-unit-tests on: + + workflow_dispatch: + push: paths: - "defs/**" diff --git a/.github/workflows/front-studio-build.yml b/.github/workflows/front-studio-build.yml index 9ee15270..a28fb028 100644 --- a/.github/workflows/front-studio-build.yml +++ b/.github/workflows/front-studio-build.yml @@ -1,6 +1,9 @@ name: front-studio-build on: + + workflow_dispatch: + push: paths: - "defs/**" diff --git a/.github/workflows/front-studio-typecheck.yml b/.github/workflows/front-studio-typecheck.yml index 27a93645..4ad9430f 100644 --- a/.github/workflows/front-studio-typecheck.yml +++ b/.github/workflows/front-studio-typecheck.yml @@ -1,6 +1,9 @@ name: front-studio-typecheck on: + + workflow_dispatch: + push: paths: - "defs/**" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b0113da4..f3d0d33c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,8 @@ jobs: release: - runs-on: self-hosted-release + # runs-on: self-hosted-release + runs-on: ubuntu-latest strategy: matrix: @@ -20,32 +21,35 @@ jobs: 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/action-local-cache@1.0.0 + # cache-all-crates: true + # shared-key: release + + # - name: Local cargo cache + # id: release-cargo-cache + # uses: MasterworksIO/action-local-cache@1.0.0 + # 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