Skip to content

Commit

Permalink
Activate caching and remove YAML devops nonsense
Browse files Browse the repository at this point in the history
* Activates ccache for continuous-integration
* Moves all CI code into a file .github/continuous-integration.sh
  • Loading branch information
segeljakt committed Jul 22, 2021
1 parent 2611978 commit aad2f6d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 28 deletions.
41 changes: 41 additions & 0 deletions .github/continuous-integration.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

set -e # Terminates as soon as something fails

export PATH="$A2M_BUILD/llvm-build/bin:$PATH"

function run-step {
echo "Running $@"
"$@"
}

if [[ -d "${PERSIST_DIR}/ccache-cachedir" ]]; then
echo "The Ccache directory exists at ${PERSIST_DIR}/ccache-cachedir"
else
echo "Creating Ccache directory at ${PERSIST_DIR}/ccache-cachedir"
mkdir -p ${PERSIST_DIR}/ccache-cachedir
envsubst > ${PERSIST_DIR}/ccache-config <<EOF
max_size = 20G
cache_dir = ${PERSIST_DIR}/ccache-cachedir
EOF
fi

(
run-step cd arc-mlir
A2M_CCACHE="1" BUILD_FLAVOUR=Release A2M_ASSERTS="1" run-step ./arc-mlir-build
run-step ninja -C $A2M_BUILD/llvm-build/ check-arc-mlir
)

(
run-step cd arc-script
run-step cargo insta test --package=arc-script-test-compile
run-step cargo insta accept
run-step cargo clippy
run-step cargo check
run-step cargo check --bins
run-step cargo check --tests
run-step cargo check --examples
run-step cargo check --benches
run-step cargo fuzz run parse -- -runs=10000 -only-ascii
# run-step cargo fmt -- -v --check
)
36 changes: 8 additions & 28 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ on:
pull_request:
branches: [ master ]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: self-hosted

env:
CARGO_TERM_COLOR: always
CCACHE_CONFIGPATH: /root/actions-runner/persist/ccache-config
PERSIST_DIR: /root/actions-runner/persist/

steps:

# Checkout branch which we want to test
Expand All @@ -21,32 +23,10 @@ jobs:
- name: Update submodule
run: git submodule update --init --recursive

- name: Update system path
run: echo "$A2M_BUILD/llvm-build/bin/" >> $GITHUB_PATH
env:
A2M_BUILD: ${{ format('{0}/build', runner.temp) }}

# Arc-MLIR specific tests
- name: Build and test arc-mlir
run: |
cd arc-mlir
./arc-mlir-build
ninja tools/arc-mlir/arc-check -C $A2M_BUILD/llvm-build/
cd ../arc-script
cargo insta test --package=arc-script-test-compile
cargo insta accept
cargo clippy
cargo check
cargo check --bins
cargo check --tests
cargo check --examples
cargo check --benches
cargo fuzz run parse -- -runs=10000 -only-ascii
# cargo fmt -- -v --check
- name: Execute CI
run: ./.github/continuous-integration.sh
env:
A2M_BUILD: ${{ format('{0}/build', runner.temp) }}

- name: Check for dirty tree
run: |
./check-for-dirty-tree
run: ./check-for-dirty-tree

0 comments on commit aad2f6d

Please sign in to comment.