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

update ci workflow #28

Merged
merged 3 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
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
132 changes: 80 additions & 52 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,23 @@ on:

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUST_BACKTRACE: short
RUSTFLAGS: "-D warnings"
RUSTUP_MAX_RETRIES: 10

jobs:
lint:
runs-on: ubuntu-latest
container: circleci/rust:bullseye

steps:
# The Docker file changes sets USER to circleci instead of using the default user, so we need to update file permissions for this image to work on GH Actions.
# See https://docs.github.com/actions/reference/virtual-environments-for-github-hosted-runners#docker-container-filesystem
- name: Setup file system permissions
run: sudo chmod -R 777 $GITHUB_WORKSPACE /github /__w/_temp

- uses: actions/checkout@v3

- name: Install Rust
# will install toolchain specified in rust-toolchain
- name: Install Rust toolchain
run: |
rustup toolchain install 1.60.0-x86_64-unknown-linux-gnu
rustup component add rustfmt --toolchain 1.60.0-x86_64-unknown-linux-gnu
rustup component add clippy --toolchain 1.60.0-x86_64-unknown-linux-gnu
sudo chmod -R 777 $GITHUB_WORKSPACE /github /__w/_temp
echo 'RUSTFLAGS=-D warnings' >> $GITHUB_ENV
rustup show

- name: Version Information
run: |
Expand All @@ -41,60 +37,75 @@ jobs:
cargo fmt -- --version
cargo clippy -- --version

- name: Cache Dependencies
uses: Swatinem/rust-cache@v2

- name: Lint (rustfmt)
run: |
cargo fmt -- --check

- name: Lint (clippy)
run: |
cargo clippy --all-features --all-targets
cargo clippy --locked --workspace --all-features --all-targets

tests:
runs-on: ubuntu-latest
container: circleci/rust:bullseye

steps:
# The Docker file changes sets USER to circleci instead of using the default user, so we need to update file permissions for this image to work on GH Actions.
# See https://docs.github.com/actions/reference/virtual-environments-for-github-hosted-runners#docker-container-filesystem
- name: Setup file system permissions
run: sudo chmod -R 777 $GITHUB_WORKSPACE /github /__w/_temp

- uses: actions/checkout@v3

- name: Install Rust
# will install toolchain specified in rust-toolchain
- name: Install Rust toolchain
run: |
rustup toolchain install 1.60.0-x86_64-unknown-linux-gnu
sudo chmod -R 777 $GITHUB_WORKSPACE /github /__w/_temp
echo 'RUSTFLAGS=-D warnings' >> $GITHUB_ENV

- name: Setup Additional Languages
rustup show

- name: Setup Additional Languages (python3)
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Setup Additional Languages (python3 packages)
run: |
sudo chmod -R 777 $GITHUB_WORKSPACE /github /__w/_temp
sudo apt-get update
sudo apt-get install -y apt-transport-https python3-all-dev python3-pip default-jdk golang-1.15-go
echo '/usr/lib/go-1.15/bin' >> $GITHUB_PATH
python3 -m pip install pyre-check==0.0.59
python3 -m pip install numpy==1.20.1
echo '/github/home/.local/bin' >> $GITHUB_PATH
wget https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y dotnet-sdk-2.1 dotnet-sdk-3.1
curl -fsSL https://deno.land/x/install/install.sh | sh
echo 'DENO_INSTALL=/github/home/.deno' >> $GITHUB_ENV
echo '/github/home/.deno/bin' >> $GITHUB_PATH
sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
sudo apt-get update
sudo apt-get install dart
sudo apt-get install binutils git gnupg2 libc6-dev libcurl4 libedit2 libgcc-9-dev libpython2.7 libsqlite3-0 libstdc++-9-dev libxml2 libz3-dev pkg-config tzdata zlib1g-dev -y
wget https://swift.org/builds/swift-5.3.3-release/ubuntu2004/swift-5.3.3-RELEASE/swift-5.3.3-RELEASE-ubuntu20.04.tar.gz
tar xzf swift-5.3.3-RELEASE-ubuntu20.04.tar.gz
sudo mkdir -p /opt
sudo mv swift-5.3.3-RELEASE-ubuntu20.04 /opt/swift
echo '/opt/swift/usr/bin' >> $GITHUB_PATH
sudo apt-get install opam
opam init --disable-sandboxing -y

- name: Setup Additional Languages (.Net)
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
2.1.x
3.1.x

- name: Setup Additional Languages (golang)
uses: actions/setup-go@v3
with:
go-version: '~1.15.0'

- name: Setup Additional Languages (deno)
uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Setup Additional Languages (dart)
uses: dart-lang/setup-dart@v1
with:
sdk: 2.14.0

- name: Setup Additional Languages (swift)
uses: swift-actions/setup-swift@v1
with:
# older swift versions are having gpg issues https://github.com/swift-actions/setup-swift/issues/520
swift-version: "5.7"

- name: Setup Additional Languages (ocaml)
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: 4.14.x
opam-disable-sandboxing: true

- name: Setup Additional Languages (ocaml packages)
run: |
eval $(opam env)
opam install -y stdint uutf ppxlib

Expand All @@ -112,12 +123,29 @@ jobs:
deno --version
dart --version
swift --version
eval $(opam env)
ocaml --version

- name: Build and Test
- name: Compile (dev tests)
run: cargo test --no-run --locked

# It's faster to `test` before `build` according to
# https://github.com/rust-lang/rust-analyzer/blob/97b357e41b99ee3d5dd72a1640f6c74e4f4d6b64/.github/workflows/ci.yaml#L55
- name: Compile (dev serde-reflection)
run: cargo build --locked --all-targets

- name: Test (dev)
run: |
eval $(opam env)
cargo build --all-targets
cargo test
cargo build --release --all-targets --all-features
cargo test --release --all-features

- name: Compile (release tests)
run: cargo test --no-run --locked --release --all-features

- name: Compile (release serde-reflection)
run: cargo build --locked --release --all-targets --all-features

- name: Test (release)
run: |
eval $(opam env)
cargo test --locked --release --all-features
1 change: 0 additions & 1 deletion rust-toolchain

This file was deleted.

3 changes: 3 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[toolchain]
channel = "1.60.0"
profile = "default"
1 change: 1 addition & 0 deletions serde-generate/runtime/cpp/bcs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include <algorithm>
#include <cassert>
#include <limits>

#include "binary.hpp"
#include "serde.hpp"
Expand Down
1 change: 1 addition & 0 deletions serde-generate/runtime/cpp/bincode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#pragma once

#include <cstdint>
#include <limits>

#include "binary.hpp"
#include "serde.hpp"
Expand Down