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

GH-777: Improve caching in GitHub workflow #423

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
98 changes: 50 additions & 48 deletions .github/workflows/ci-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,8 @@ jobs:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Stable with rustfmt and clippy
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.63.0
components: rustfmt, clippy
override: true
- uses: actions/cache@v3
- name: Cache Cargo Files
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
Expand All @@ -39,7 +33,14 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Stable with rustfmt and clippy
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.63.0
components: rustfmt, clippy
override: true
- name: Build ${{ matrix.target.os }}
run: |
./ci/all.sh
Expand All @@ -51,53 +52,54 @@ jobs:
with:
name: Node-${{ matrix.target.name }}
path: results

deploy_to_s3:
needs: build
strategy:
matrix:
os: [linux, macos, windows]
os: [linux, macos, windows]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v3

- name: Display structure of downloaded files
run: ls -R
- name: Display structure of downloaded files
run: ls -R

- if: startsWith(github.head_ref, 'GH')
name: Versioned S3 Sync
uses: jakejarvis/[email protected]
with:
args: --acl private --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-west-2'
DEST_DIR: 'Node/${{ github.event.workflow_run.head_branch }}/Node-${{ matrix.os }}'
SOURCE_DIR: 'Node-${{ matrix.os }}/generated/bin/'
- if: startsWith(github.head_ref, 'GH')
name: Versioned S3 Sync
uses: jakejarvis/[email protected]
with:
args: --acl private --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-west-2'
DEST_DIR: 'Node/${{ github.event.workflow_run.head_branch }}/Node-${{ matrix.os }}'
SOURCE_DIR: 'Node-${{ matrix.os }}/generated/bin/'

- if: startsWith(github.head_ref, 'v')
name: Latest S3 Sync
uses: jakejarvis/[email protected]
with:
args: --acl private --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-west-2'
DEST_DIR: 'Node/latest/Node-${{ matrix.os }}'
SOURCE_DIR: 'Node-${{ matrix.os }}/generated/bin/'
- if: startsWith(github.head_ref, 'v')
name: Latest S3 Sync
uses: jakejarvis/[email protected]
with:
args: --acl private --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-west-2'
DEST_DIR: 'Node/latest/Node-${{ matrix.os }}'
SOURCE_DIR: 'Node-${{ matrix.os }}/generated/bin/'

- name: Invalidate Binaries CloudFront
uses: chetan/[email protected]
env:
DISTRIBUTION: ${{ secrets.DISTRIBUTION }}
PATHS: "/Node*"
AWS_REGION: "us-west-2"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Invalidate Binaries CloudFront
uses: chetan/[email protected]
env:
DISTRIBUTION: ${{ secrets.DISTRIBUTION }}
PATHS: "/Node*"
AWS_REGION: "us-west-2"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Loading