Skip to content

Commit

Permalink
Merge pull request #44 from l-monninger/main
Browse files Browse the repository at this point in the history
[CICD] linux x86_64 as action
  • Loading branch information
l-monninger authored Sep 24, 2023
2 parents fbe017e + 5419a5c commit 811fbfc
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 29 deletions.
Empty file removed .devcontainer/Dockerfile
Empty file.
Empty file removed .devcontainer/devcontainer.json
Empty file.
24 changes: 24 additions & 0 deletions .devcontainer/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Use the official Ubuntu image as a base
FROM ubuntu:latest

# Set environment variables to non-interactive (this prevents some prompts)
ENV DEBIAN_FRONTEND=non-interactive

# Install necessary tools and libraries
RUN apt-get update && apt-get install -y \
curl \
build-essential \
pkg-config \
libssl-dev

# Install Rust using rustup
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

# Add Rust to the PATH
ENV PATH="/root/.cargo/bin:${PATH}"

# Set the working directory in the container
WORKDIR /workspace

# Command to run on container start
CMD [ "bash" ]
19 changes: 19 additions & 0 deletions .devcontainer/ubuntu/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "ubuntu",
"dockerFile": "Dockerfile",
"context": ".",
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
"extensions": [
"rust-lang.rust"
],
"forwardPorts": [],
"postCreateCommand": "cargo check",
"remoteUser": "root"
}
16 changes: 16 additions & 0 deletions .github/actions/setup-linux-x86_64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Setup Linux x86_64'
description: 'Sets up the environment for Linux x86_64 builds with Rust'

runs:
using: 'composite'
steps:

- name: Install build essentials
run: sudo apt-get update && sudo apt-get install -y build-essential lld
shell: bash

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.70
28 changes: 19 additions & 9 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,32 @@ jobs:
labels: movement-runner

steps:

- name: Checkout Repository
uses: actions/checkout@v2
with:
submodules: 'recursive'

- name: Install build essentials
run: sudo apt-get update && sudo apt-get install -y build-essential lld
- name: Setup
uses: ./.github/actions/setup-linux-x86_64.yml

- name: Print Linker Version
run: ld --version

- name: Set up Rust
uses: actions-rs/toolchain@v1
- name: Cache cargo registry
uses: actions/cache@v2
with:
profile: minimal
toolchain: 1.70
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo build
uses: actions/cache@v2
with:
path: ./m1/target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}

- name: Run Cargo Check
working-directory: ./m1
Expand Down
19 changes: 6 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,8 @@ jobs:
with:
submodules: 'recursive'

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.70.0

- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential
- name: Install aarch64 target
run: rustup target add aarch64-unknown-linux-gnu
- name: Setup
uses: ./.github/actions/setup-linux-x86_64.yml

- name: Debugging Info
run: |
Expand Down Expand Up @@ -101,6 +90,7 @@ jobs:
asset_name: movement-x86_64-linux
asset_content_type: application/octet-stream


pre-release-x86_64-mac:
if: false # not yet supported
needs: prepare-release
Expand Down Expand Up @@ -203,6 +193,7 @@ jobs:
asset_name: movement-aarch64-linux
asset_content_type: application/octet-stream


pre-release-aarch64-mac:
if: false # not yet supported
needs: prepare-release
Expand Down Expand Up @@ -254,6 +245,7 @@ jobs:
asset_name: movement-aarch64-mac
asset_content_type: application/octet-stream


pre-release-x86_64-windows:
if: false # not yet supported
needs: prepare-release
Expand Down Expand Up @@ -299,6 +291,7 @@ jobs:
asset_path: ./m1/target/release/movement
asset_name: movement-x86_64-windows
asset_content_type: application/octet-stream


build-and-docker:
if:
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,19 @@ jobs:
labels: movement-runner
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout code

- name: Checkout Repository
uses: actions/checkout@v2
with:
submodules: 'recursive'

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.70.0
- name: Setup
uses: ./.github/actions/setup-linux-x86_64.yml

- name: Build and Test Subnet
run: |
cd ./m1
RUSTFLAGS="--cfg tokio_unstable" cargo test --lib # this should only be the lib tests
# cargo test --lib # this should only be the lib tests
- name: Update Badge
run: |
Expand Down

0 comments on commit 811fbfc

Please sign in to comment.