Skip to content

Commit

Permalink
fix: CI
Browse files Browse the repository at this point in the history
  • Loading branch information
gabyx committed Jun 28, 2024
1 parent 5e77c97 commit d839be4
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 53 deletions.
108 changes: 56 additions & 52 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
---
name: rdf-protect

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

on:
push:
branches:
Expand All @@ -23,57 +26,58 @@ jobs:
uses: actions/checkout@v4
- name: 1 - format
run: |
cat /etc/os-release
source .gitlab/scripts/before-script.sh
just nix-develop-ci just format
lint:
runs-on: ubuntu-latest
container:
image: ghcr.io/sdsc-ordes/rdf-protect:ci-lint-1.0.0
steps:
- name: Checkout
uses: actions/checkout@v4
- name: 2 - lint
run: |
source .gitlab/scripts/before-script.sh &&
just nix-develop-ci just lint
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/sdsc-ordes/rdf-protect:ci-build-1.0.0
steps:
- name: Checkout
uses: actions/checkout@v4
- name: 3 - build
run: |
source .gitlab/scripts/before-script.sh &&
just nix-develop-ci just build
# - name: 3.1 - tests
# run: |
# source .gitlab/scripts/before-script.sh &&
# just nix-develop-ci just test

test:
runs-on: ubuntu-latest
container:
image: ghcr.io/sdsc-ordes/rdf-protect:ci-test-1.0.0
steps:
- name: Checkout
uses: actions/checkout@v4
- name: 4 - test
run: |
source .gitlab/scripts/before-script.sh &&
just nix-develop-ci just test
package:
runs-on: ubuntu-latest
container:
image: ghcr.io/sdsc-ordes/rdf-protect:ci-package-1.0.0
steps:
- name: Checkout
uses: actions/checkout@v4
- name: 5 - package (nix)
run: |
source .gitlab/scripts/before-script.sh &&
just build-package
# lint:
# runs-on: ubuntu-latest
# container:
# image: ghcr.io/sdsc-ordes/rdf-protect:ci-lint-1.0.0
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: 2 - lint
# run: |
# source .gitlab/scripts/before-script.sh &&
# just nix-develop-ci just lint
#
# build:
# runs-on: ubuntu-latest
# container:
# image: ghcr.io/sdsc-ordes/rdf-protect:ci-build-1.0.0
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: 3 - build
# run: |
# source .gitlab/scripts/before-script.sh &&
# just nix-develop-ci just build
# # - name: 3.1 - tests
# # run: |
# # source .gitlab/scripts/before-script.sh &&
# # just nix-develop-ci just test
#
# test:
# runs-on: ubuntu-latest
# container:
# image: ghcr.io/sdsc-ordes/rdf-protect:ci-test-1.0.0
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: 4 - test
# run: |
# source .gitlab/scripts/before-script.sh &&
# just nix-develop-ci just test
#
# package:
# runs-on: ubuntu-latest
# container:
# image: ghcr.io/sdsc-ordes/rdf-protect:ci-package-1.0.0
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: 5 - package (nix)
# run: |
# source .gitlab/scripts/before-script.sh &&
# just build-package
3 changes: 3 additions & 0 deletions .gitlab/scripts/before-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# This script is sourced.
set -u

echo "Config global:"
git config --global --list | cat

ROOT_DIR=$(git rev-parse --show-toplevel)
. "$ROOT_DIR/tools/general.sh"

Expand Down
8 changes: 7 additions & 1 deletion tools/format-rust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ ROOT_DIR=$(git rev-parse --show-toplevel)
cd "$ROOT_DIR"

print_info "Run Rust format."

fmt_args=()
if ci_is_running; then
fmt_args+=("--check")
fi

ci_wrap_container \
ghcr.io/sdsc-ordes/rdf-protect:ci-format-1.0.0 \
nix develop ./tools/nix#ci --command \
cargo fmt "$@"
cargo fmt "${fmt_args[@]}" "$@"

0 comments on commit d839be4

Please sign in to comment.