Skip to content

Commit

Permalink
add cache key
Browse files Browse the repository at this point in the history
  • Loading branch information
vnghia committed Apr 14, 2024
1 parent 294806b commit 3573dcd
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
- uses: Swatinem/rust-cache@v2
- name: Extract build information
id: build
env:
Expand All @@ -111,6 +110,9 @@ jobs:
echo "docker-arch=${{ startsWith(matrix.platform.target, 'x86_64') && 'amd64' || 'arm64' }}" >> "$GITHUB_OUTPUT"
echo "profile=${{ (github.event_name == 'release' || github.event_name == 'workflow_dispatch') && 'release' || 'dev' }}" >> "$GITHUB_OUTPUT"
echo "output-dir=${{ (github.event_name == 'release' || github.event_name == 'workflow_dispatch') && 'release' || 'debug' }}" >> "$GITHUB_OUTPUT"
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.platform.target }}-${{ steps.build.outputs.profile }}
- name: Increase postgres max connection
run: |
docker exec -i postgres bash << EOF
Expand Down Expand Up @@ -256,12 +258,14 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
- uses: Swatinem/rust-cache@v2
- name: Extract build information
id: build
run: |
echo "profile=${{ (github.event_name == 'release' || github.event_name == 'workflow_dispatch') && 'release' || 'dev' }}" >> $env:GITHUB_OUTPUT
echo "output-dir=${{ (github.event_name == 'release' || github.event_name == 'workflow_dispatch') && 'release' || 'debug' }}" >> $env:GITHUB_OUTPUT
- uses: Swatinem/rust-cache@v2
with:
key: x86_64-pc-windows-msvc-${{ steps.build.outputs.profile }}

- name: Install and setup postgres
run: |
Expand Down Expand Up @@ -327,7 +331,6 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
- uses: Swatinem/rust-cache@v2
- name: Extract build information
id: build
env:
Expand All @@ -337,6 +340,9 @@ jobs:
echo "docker-arch=${{ startsWith(matrix.platform.target, 'x86_64') && 'amd64' || 'arm64' }}" >> "$GITHUB_OUTPUT"
echo "profile=${{ (github.event_name == 'release' || github.event_name == 'workflow_dispatch') && 'release' || 'dev' }}" >> "$GITHUB_OUTPUT"
echo "output-dir=${{ (github.event_name == 'release' || github.event_name == 'workflow_dispatch') && 'release' || 'debug' }}" >> "$GITHUB_OUTPUT"
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.platform.target }}-${{ steps.build.outputs.profile }}

- name: Install and setup postgres
run: |
Expand Down

0 comments on commit 3573dcd

Please sign in to comment.