Skip to content
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
20 changes: 10 additions & 10 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name: Docker Publish

on:
release:
types: [created]
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
push: true
tags: dlsz/floresta:latest
push: true
tags: dlsz/floresta:latest
35 changes: 20 additions & 15 deletions .github/workflows/functional.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
# runs our functinal tests from tests/

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
push:
pull_request:
branches: ["master"]

jobs:
functional:
name: functional
runs-on: ubuntu-latest
functional:
name: Functional
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: prepare environment
run: sudo apt-get install -y python3-pip && pip3 install -r tests/requirements.txt
- name: build
run: cargo build
- name: run functional tests
run: python tests/run_tests.py
steps:
- uses: actions/checkout@v4

- name: Prepare environment
run: sudo apt-get install -y python3-pip && pip3 install -r tests/requirements.txt

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

- name: Build Floresta
run: cargo build

- name: Run functional tests
run: python tests/run_tests.py
71 changes: 49 additions & 22 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ name: Rust

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
branches: ["master"]

env:
CARGO_TERM_COLOR: always
Expand All @@ -14,17 +13,23 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: install nightly rust
run: rustup install nightly; rustup +nightly component add rustfmt clippy

# cargo fmt
- uses: actions/checkout@v3
- name: fmt
run: cargo +nightly fmt --all --check

# run cargo clippy
- name: Clippy
run: cargo +nightly clippy --all-targets
- uses: actions/checkout@v4

- name: Install latest nightly
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy

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

- name: Run cargo fmt
run: cargo fmt --all --check

- name: Run cargo clippy
run: cargo clippy --all-targets
env:
PWD: ${{ github.workspace }} # without it ci can't see env!("PWD")

cross-testing:
strategy:
Expand All @@ -33,19 +38,41 @@ jobs:

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Cache Rust
uses: actions/cache@v4
with:
toolchain: ${{ matrix.rust }}
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Build Floresta
run: cargo build --verbose

- run: cargo build --verbose
- run: cargo test --verbose
- name: Run tests
run: cargo test --verbose
env:
PWD: ${{ github.workspace }} # without it ci can't see env!("PWD")

build-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: build the docker image
run: docker build -t dlsz/floresta:latest .
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-docker-${{ hashFiles('Dockerfile') }}

- name: Build Docker image
run: |
docker buildx build --cache-to=type=local,dest=/tmp/.buildx-cache --cache-from=type=local,src=/tmp/.buildx-cache -t dlsz/floresta:latest .