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

Fix CI on master #2193

Merged
merged 3 commits into from
Jan 30, 2025
Merged

Fix CI on master #2193

merged 3 commits into from
Jan 30, 2025

Conversation

coolreader18
Copy link
Collaborator

Description of Changes

Follow up to #2011, fixes #2159. I merged the different packaging jobs into a matrix, since it seems like they were all copy/pasted anyway and it makes it easier to make sure that the packaging process is consistent. I also tweaked the names of the artifacts, as I was talking about in #2126 (cc @clockworklabs/devops); they're now spacetime-$LLVM_TARGET_TRIPLE.$EXE_OR_TARGZ. I didn't maintain the cp --sparse=never thing from #544, since it seems like the tar crate now supports sparse archives.

Expected complexity level and risk

2

Testing

  • master CI basically succeeds on this branch, check the first commit - the only reason it's failing is because docker doesn't like the slash character in noa/fix-master-ci for a tag name, but that obviously won't be an issue on master.

.github/workflows/linux-build.yml Fixed Show resolved Hide resolved
@bfops bfops self-requested a review January 30, 2025 00:08
Copy link
Collaborator

@bfops bfops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for doing this! This looks great. A few small comments and then I think we're good to go.

.github/workflows/linux-build.yml Outdated Show resolved Hide resolved
.github/workflows/linux-build.yml Outdated Show resolved Hide resolved
.github/workflows/linux-build.yml Outdated Show resolved Hide resolved
.github/workflows/linux-build.yml Outdated Show resolved Hide resolved
Comment on lines +13 to +70
strategy:
fail-fast: false
matrix:
include:
- { name: x86_64 Linux, target: x86_64-unknown-linux-gnu, runner: bare-metal }
- { name: aarch64 Linux, target: aarch64-unknown-linux-gnu, runner: arm-runner }
- { name: aarch64 macOS, target: aarch64-apple-darwin, runner: macos-latest }
- { name: x86_64 macOS, target: x86_64-apple-darwin, runner: macos-latest }
- { name: x86_64 Windows, target: x86_64-pc-windows-msvc, runner: windows-latest }

name: Build CLI for ${{ matrix.name }}
runs-on: ${{ matrix.runner }}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Show arch
run: uname -a

- name: Install Rust
uses: dsherret/rust-toolchain-file@v1

- name: Install rust target
run: rustup target add ${{ matrix.target }}

- name: Compile
run: |
cargo build --release --target ${{ matrix.target }} -p spacetimedb-cli -p spacetimedb-standalone -p spacetimedb-update

- name: Package (unix)
if: ${{ runner.os != 'Windows' }}
run: |
mkdir build
cd target/${{matrix.target}}/release
tar -czf ../../../build/spacetime-${{matrix.target}}.tar.gz spacetimedb-{cli,standalone,update}

- name: Package (windows)
if: ${{ runner.os == 'Windows' }}
run: |
mkdir build
cd target/${{matrix.target}}/release
7z a ../../../build/spacetime-${{matrix.target}}.zip spacetimedb-cli.exe spacetimedb-standalone.exe spacetimedb-update.exe

- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Upload to DO Spaces
uses: shallwefootball/s3-upload-action@master
with:
aws_key_id: ${{ secrets.AWS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws_bucket: ${{ vars.AWS_BUCKET }}
source_dir: build
endpoint: https://nyc3.digitaloceanspaces.com
destination_dir: ${{ steps.extract_branch.outputs.branch }}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions Job or Workflow does not set permissions
run: uname -a

- name: Install Rust
uses: dsherret/rust-toolchain-file@v1

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Package SpacetimeDB CLI' step
Uses Step
uses 'dsherret/rust-toolchain-file' with ref 'v1', not a pinned commit hash
id: extract_branch

- name: Upload to DO Spaces
uses: shallwefootball/s3-upload-action@master

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Package SpacetimeDB CLI' step
Uses Step
uses 'shallwefootball/s3-upload-action' with ref 'master', not a pinned commit hash
Copy link
Collaborator

@bfops bfops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking concerns left for me!

I think we should test the artifacts on MacOS + Windows to make sure they still work, but since they're currently broken, this PR definitely can't make things worse.

Windows link: https://spacetimedb-client-binaries.nyc3.digitaloceanspaces.com/noa/fix-master-ci/spacetime-x86_64-pc-windows-msvc.zip
Apple amd64: https://spacetimedb-client-binaries.nyc3.digitaloceanspaces.com/noa/fix-master-ci/spacetime-x86_64-apple-darwin.tar.gz
Apple arm64: https://spacetimedb-client-binaries.nyc3.digitaloceanspaces.com/noa/fix-master-ci/spacetime-aarch64-apple-darwin.tar.gz

(The Linux one seems to work for me, I un-tard and ran a trivial command on each of the binaries).

@coolreader18 coolreader18 added this pull request to the merge queue Jan 30, 2025
Merged via the queue into master with commit d4a905d Jan 30, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI - Fix build jobs
2 participants