-
Notifications
You must be signed in to change notification settings - Fork 2
[CPP-53]Create github actions for building installer. #4
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
db85a73
[CPP-53]Create github actions for building installer.
john-michaelburke d0ce148
Working nuitka binary for linux.
john-michaelburke e767bc7
Responding to review requests.
john-michaelburke 35fbb16
Respond to reviews.
john-michaelburke e5ef8f2
Cleaned up fbs resources function.
john-michaelburke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -x | ||
set -o errexit | ||
set -o pipefail | ||
|
||
archive_name="console_pp" | ||
|
||
if [[ "$OS_NAME" == "macOS" ]]; then | ||
(strip 'Swift Navigation Console.dmg'); | ||
tar -czf ${archive_name}_osx.tar.gz 'Swift Navigation Console.dmg'; | ||
VERSION="$(git describe --always --tags --dirty)"; | ||
BUILD_TRIPLET="$(gcc -dumpmachine)"; | ||
mv ${archive_name}_osx.tar.gz "${archive_name}-${VERSION}-${BUILD_TRIPLET}.tar.gz"; | ||
echo "${archive_name}-${VERSION}-${BUILD_TRIPLET}.tar.gz" >release-archive.filename; | ||
ls -l; | ||
fi | ||
|
||
if [[ "$OS_NAME" == "Linux" ]]; then | ||
(cd target; strip 'Swift Navigation Console.deb'); | ||
tar -C "target" -czf ${archive_name}_linux.tar.gz 'Swift Navigation Console.deb'; | ||
VERSION="$(git describe --always --tags --dirty)"; | ||
BUILD_TRIPLET="$(gcc -dumpmachine)"; | ||
mv ${archive_name}_linux.tar.gz "${archive_name}-${VERSION}-${BUILD_TRIPLET}.tar.gz"; | ||
echo "${archive_name}-${VERSION}-${BUILD_TRIPLET}.tar.gz" >release-archive.filename; | ||
ls -l; | ||
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
name: main | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
|
||
jobs: | ||
checks: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
ssh-key: ${{ secrets.SSH_KEY }} | ||
|
||
- name: Install stable Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
components: rustfmt, clippy | ||
- uses: davidB/rust-cargo-make@v1 | ||
with: | ||
version: '0.32.11' | ||
- name: Cache conda | ||
uses: actions/cache@v1 | ||
env: | ||
CACHE_NUMBER: 0 | ||
with: | ||
path: ~/conda_pkgs_dir | ||
key: | ||
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ | ||
hashFiles('conda.yml') }} | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
activate-environment: console_pp | ||
environment-file: conda.yml | ||
use-only-tar-bz2: true | ||
- name: Install Dependencies. | ||
run: | | ||
if [ "$RUNNER_OS" == "Linux" ]; then | ||
sudo apt-get install -y capnproto ruby ruby-dev rubygems build-essential | ||
sudo gem install --no-document fpm | ||
elif [ "$RUNNER_OS" == "macOS" ]; then | ||
brew install capnp | ||
fi | ||
shell: bash | ||
|
||
- name: Poetry Install | ||
run: | | ||
conda activate console_pp | ||
python -m poetry install | ||
|
||
- name: Run Format Check | ||
run: | | ||
conda activate console_pp | ||
cargo make format-check | ||
|
||
- name: Run Type Check | ||
run: | | ||
conda activate console_pp | ||
cargo make types | ||
|
||
- name: Run Lint Check | ||
run: | | ||
conda activate console_pp | ||
cargo make lint | ||
|
||
- name: Run Tests | ||
run: | | ||
conda activate console_pp | ||
cargo make tests | ||
|
||
build: | ||
name: Build Binaries | ||
needs: | ||
- checks | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-20.04 | ||
- macos-10.15 | ||
runs-on: ${{ matrix.os }} | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
|
||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
ssh-key: ${{ secrets.SSH_KEY }} | ||
|
||
- name: Install ${{ runner.os }} Dependencies. | ||
run: | | ||
if [ "$RUNNER_OS" == "Linux" ]; then | ||
sudo apt-get install -y capnproto ruby ruby-dev rubygems build-essential | ||
sudo gem install --no-document fpm | ||
elif [ "$RUNNER_OS" == "macOS" ]; then | ||
brew install capnp | ||
fi | ||
|
||
- name: Install stable Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
components: rustfmt, clippy | ||
- uses: davidB/rust-cargo-make@v1 | ||
with: | ||
version: '0.32.11' | ||
|
||
- name: Cache conda | ||
uses: actions/cache@v1 | ||
env: | ||
CACHE_NUMBER: 0 | ||
with: | ||
path: ~/conda_pkgs_dir | ||
key: | ||
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ | ||
hashFiles('conda.yml') }} | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
activate-environment: console_pp | ||
environment-file: conda.yml | ||
use-only-tar-bz2: true | ||
|
||
- name: Poetry Install | ||
run: | | ||
conda activate console_pp | ||
python -m poetry install | ||
|
||
- name: Build ${{ runner.os }} Binaries. | ||
env: | ||
OS_NAME: ${{ runner.os }} | ||
run: | | ||
conda activate console_pp | ||
if [ "$RUNNER_OS" == "Linux" ]; then | ||
cargo make prod-installer | ||
elif [ "$RUNNER_OS" == "macOS" ]; then | ||
cargo make prod-mac-nuitka-installer | ||
fi | ||
bash ./.github/ci-build.sh | ||
echo "RELEASE_ARCHIVE=$(cat release-archive.filename)" >>$GITHUB_ENV | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ runner.os }}-artifacts | ||
path: | | ||
${{ env.RELEASE_ARCHIVE }} | ||
release-archive.filename |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
__pycache__ | ||
target | ||
.mypy_cache | ||
.doit* | ||
*.build | ||
*.dist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
name: console_pp | ||
dependencies: | ||
- python=3.8 | ||
- pip: | ||
- poetry==1.1.4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
extern crate capnpc; | ||
|
||
fn main() { | ||
|
||
let output_dir = std::env::var("OUT_DIR").unwrap(); | ||
|
||
::capnpc::CompilerCommand::new() | ||
.file("console_backend.capnp") | ||
.output_path(output_dir) | ||
.run() | ||
.unwrap(); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*.pyd | ||
*.so |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
pub mod server; | ||
|
||
pub mod console_backend_capnp { | ||
include!(concat!(env!("OUT_DIR"), "/console_backend_capnp.rs")); | ||
} | ||
include!(concat!(env!("OUT_DIR"), "/console_backend_capnp.rs")); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there is a way to keep this a bit more dry - I have a wip pr for adding github actions to libsbp - https://github.com/swift-nav/libsbp/pull/905/files#diff-9ed853ee5016b3f7cb01ee3da6506fd9e926a923324f327507c34e64f83dfe10R1
With the key bit being (in the
build
job)-All the rust toolchain stuff should just work ™️, not sure about the python.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I really like this flow thank you for the suggestion!