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

[DO NOT MERGE] Testing build for basic-cli #305 #7488

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions .github/workflows/basic_cli_build_release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
on:
# pull_request:
pull_request:
workflow_dispatch:

# this cancels workflows currently in progress if you start a new one
Expand All @@ -11,7 +11,7 @@ env:
# use .tar.gz for quick testing
ARCHIVE_FORMAT: .tar.br
# Make a new basic-cli git tag and set it here before starting this workflow
RELEASE_TAG: 0.18.0
RELEASE_TAG: testing-305

jobs:
prepare:
Expand Down
323 changes: 162 additions & 161 deletions .github/workflows/ci_manager.yml
Original file line number Diff line number Diff line change
@@ -1,170 +1,171 @@
on:
pull_request:
# pull_request:

name: CI manager

# cancel current runs when a new commit is pushed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check-changes:
runs-on: ubuntu-22.04
outputs:
run_tests: ${{ steps.filecheck.outputs.run_tests }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check if only css, html or md files changed
id: check_ignored_files
run: |
git fetch origin ${{ github.base_ref }}
if git diff --name-only origin/${{ github.base_ref }} HEAD | grep -qvE '(\.md$|\.css$|\.html$|^AUTHORS$)'; then
echo "should_run_tests=y" >> $GITHUB_OUTPUT
else
echo "should_run_tests=n" >> $GITHUB_OUTPUT
fi

- name: Check if only comments changed in rust files
id: check_rs_comments
run: |
git fetch origin ${{ github.base_ref }}
if git diff --name-only origin/${{ github.base_ref }} HEAD | grep -qvE '(\.md$|\.css$|\.html$|^AUTHORS$|\.rs|\.roc)'; then
echo "should_run_tests=y" >> $GITHUB_OUTPUT
else
if git diff --unified=0 origin/${{ github.base_ref }} HEAD '*.rs' | grep -E --color=never '^[+-]' | grep -qvE '^(\+\+\+|\-\-\-|[+-]\s*($|\/\/[^\/]|\/\*.*\*\/\s*$))'; then
echo "should_run_tests=y" >> $GITHUB_OUTPUT
else
echo "should_run_tests=n" >> $GITHUB_OUTPUT
fi
fi

- name: Check if only comments changed in roc files
id: check_roc_comments
run: |
git fetch origin ${{ github.base_ref }}
if git diff --name-only origin/${{ github.base_ref }} HEAD | grep -qvE '(\.md$|\.css$|\.html$|^AUTHORS$|\.rs|\.roc)'; then
echo "should_run_tests=y" >> $GITHUB_OUTPUT
else
if git diff --unified=0 origin/${{ github.base_ref }} HEAD '*.roc' | grep -E --color=never '^[+-]' | grep -qvE '^(\+\+\+|\-\-\-|[+-]\s*($|#))'; then
echo "should_run_tests=y" >> $GITHUB_OUTPUT
else
echo "should_run_tests=n" >> $GITHUB_OUTPUT
fi
fi

- name: Check if tests need to run based on earlier checks
id: filecheck
run: |
if [ ${{ steps.check_ignored_files.outputs.should_run_tests }} = "y" ]; then
if [ ${{ steps.check_rs_comments.outputs.should_run_tests }} = "y" ]; then
echo "run_tests=full" >> $GITHUB_OUTPUT
else
if [ ${{ steps.check_roc_comments.outputs.should_run_tests }} = "y" ]; then
echo "run_tests=full" >> $GITHUB_OUTPUT
else
echo "run_tests=none" >> $GITHUB_OUTPUT
fi
fi
else
echo "run_tests=none" >> $GITHUB_OUTPUT
fi

- run: echo "debug output ${{ steps.filecheck.outputs.run_tests }}"

start-nix-linux-x86-64-tests:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/nix_linux_x86_64.yml

start-nix-linux-aarch64-build-default-test:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/nix_linux_arm64_default.yml

start-nix-linux-aarch64-cargo-build-test:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/nix_linux_arm64_cargo.yml

start-nix-macos-apple-silicon-tests:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/nix_macos_apple_silicon.yml

start-macos-x86-64-tests:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/macos_x86_64.yml

start-ubuntu-x86-64-tests:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/ubuntu_x86_64.yml

start-ubuntu-x86-64-nix-tests-debug:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/ubuntu_x86_64_nix_debug.yml

start-windows-release-build-test:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/windows_release_build.yml

start-windows-tests:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/windows_tests.yml

start-roc-benchmarks:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/benchmarks.yml

start-fuzzer-tests:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/fuzzer.yml

ran-full:
runs-on: ubuntu-22.04
needs: [
start-nix-linux-x86-64-tests,
start-nix-linux-aarch64-build-default-test,
start-nix-linux-aarch64-cargo-build-test,
start-nix-macos-apple-silicon-tests,
start-macos-x86-64-tests,
start-ubuntu-x86-64-tests,
start-ubuntu-x86-64-nix-tests-debug,
start-windows-release-build-test,
start-windows-tests,
start-roc-benchmarks
]
steps:
- run: echo "all workflows succeeded!"

ran-none:
runs-on: ubuntu-22.04
needs: [check-changes]
if: needs.check-changes.outputs.run_tests == 'none'
steps:
- run: echo "Only non-code files changed and/or rs and/or roc comment lines changed. CI manager did not run any workflows."

# we need a single end job for the required checks under branch protection rules
finish:
runs-on: ubuntu-22.04
needs: [ran-full, ran-none]
if: |
always()
steps:
- name: Check previous job results
run: |
if [ "${{ needs.ran-full.result }}" != "success" ] && [ "${{ needs.ran-none.result }}" != "success" ]; then
echo "One or more jobs failed."
exit 1
check-changes:
runs-on: ubuntu-22.04
outputs:
run_tests: ${{ steps.filecheck.outputs.run_tests }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check if only css, html or md files changed
id: check_ignored_files
run: |
git fetch origin ${{ github.base_ref }}
if git diff --name-only origin/${{ github.base_ref }} HEAD | grep -qvE '(\.md$|\.css$|\.html$|^AUTHORS$)'; then
echo "should_run_tests=y" >> $GITHUB_OUTPUT
else
echo "should_run_tests=n" >> $GITHUB_OUTPUT
fi

- name: Check if only comments changed in rust files
id: check_rs_comments
run: |
git fetch origin ${{ github.base_ref }}
if git diff --name-only origin/${{ github.base_ref }} HEAD | grep -qvE '(\.md$|\.css$|\.html$|^AUTHORS$|\.rs|\.roc)'; then
echo "should_run_tests=y" >> $GITHUB_OUTPUT
else
if git diff --unified=0 origin/${{ github.base_ref }} HEAD '*.rs' | grep -E --color=never '^[+-]' | grep -qvE '^(\+\+\+|\-\-\-|[+-]\s*($|\/\/[^\/]|\/\*.*\*\/\s*$))'; then
echo "should_run_tests=y" >> $GITHUB_OUTPUT
else
echo "should_run_tests=n" >> $GITHUB_OUTPUT
fi

- run: echo "Workflow succeeded :)"
fi

- name: Check if only comments changed in roc files
id: check_roc_comments
run: |
git fetch origin ${{ github.base_ref }}
if git diff --name-only origin/${{ github.base_ref }} HEAD | grep -qvE '(\.md$|\.css$|\.html$|^AUTHORS$|\.rs|\.roc)'; then
echo "should_run_tests=y" >> $GITHUB_OUTPUT
else
if git diff --unified=0 origin/${{ github.base_ref }} HEAD '*.roc' | grep -E --color=never '^[+-]' | grep -qvE '^(\+\+\+|\-\-\-|[+-]\s*($|#))'; then
echo "should_run_tests=y" >> $GITHUB_OUTPUT
else
echo "should_run_tests=n" >> $GITHUB_OUTPUT
fi
fi

- name: Check if tests need to run based on earlier checks
id: filecheck
run: |
if [ ${{ steps.check_ignored_files.outputs.should_run_tests }} = "y" ]; then
if [ ${{ steps.check_rs_comments.outputs.should_run_tests }} = "y" ]; then
echo "run_tests=full" >> $GITHUB_OUTPUT
else
if [ ${{ steps.check_roc_comments.outputs.should_run_tests }} = "y" ]; then
echo "run_tests=full" >> $GITHUB_OUTPUT
else
echo "run_tests=none" >> $GITHUB_OUTPUT
fi
fi
else
echo "run_tests=none" >> $GITHUB_OUTPUT
fi

- run: echo "debug output ${{ steps.filecheck.outputs.run_tests }}"

start-nix-linux-x86-64-tests:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/nix_linux_x86_64.yml

start-nix-linux-aarch64-build-default-test:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/nix_linux_arm64_default.yml

start-nix-linux-aarch64-cargo-build-test:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/nix_linux_arm64_cargo.yml

start-nix-macos-apple-silicon-tests:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/nix_macos_apple_silicon.yml

start-macos-x86-64-tests:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/macos_x86_64.yml

start-ubuntu-x86-64-tests:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/ubuntu_x86_64.yml

start-ubuntu-x86-64-nix-tests-debug:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/ubuntu_x86_64_nix_debug.yml

start-windows-release-build-test:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/windows_release_build.yml

start-windows-tests:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/windows_tests.yml

start-roc-benchmarks:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/benchmarks.yml

start-fuzzer-tests:
needs: check-changes
if: needs.check-changes.outputs.run_tests == 'full'
uses: ./.github/workflows/fuzzer.yml

ran-full:
runs-on: ubuntu-22.04
needs:
[
start-nix-linux-x86-64-tests,
start-nix-linux-aarch64-build-default-test,
start-nix-linux-aarch64-cargo-build-test,
start-nix-macos-apple-silicon-tests,
start-macos-x86-64-tests,
start-ubuntu-x86-64-tests,
start-ubuntu-x86-64-nix-tests-debug,
start-windows-release-build-test,
start-windows-tests,
start-roc-benchmarks,
]
steps:
- run: echo "all workflows succeeded!"

ran-none:
runs-on: ubuntu-22.04
needs: [check-changes]
if: needs.check-changes.outputs.run_tests == 'none'
steps:
- run: echo "Only non-code files changed and/or rs and/or roc comment lines changed. CI manager did not run any workflows."

# we need a single end job for the required checks under branch protection rules
finish:
runs-on: ubuntu-22.04
needs: [ran-full, ran-none]
if: |
always()
steps:
- name: Check previous job results
run: |
if [ "${{ needs.ran-full.result }}" != "success" ] && [ "${{ needs.ran-none.result }}" != "success" ]; then
echo "One or more jobs failed."
exit 1
fi

- run: echo "Workflow succeeded :)"
Loading