From 78a80a38b8088443742cbbae3f650deebf44dd90 Mon Sep 17 00:00:00 2001 From: 5ouma <101255979+5ouma@users.noreply.github.com> Date: Mon, 1 Jan 2024 11:40:49 +0900 Subject: [PATCH] ci(test): Separate scheduled test from main one To clean YAML file and know the difference. --- .github/workflows/detail-test.yml | 35 +++++++++++++++++++++++++++++++ .github/workflows/test.yml | 26 ++--------------------- 2 files changed, 37 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/detail-test.yml diff --git a/.github/workflows/detail-test.yml b/.github/workflows/detail-test.yml new file mode 100644 index 00000000..9161dcf0 --- /dev/null +++ b/.github/workflows/detail-test.yml @@ -0,0 +1,35 @@ +name: Detail Test + +on: + schedule: + - cron: "0 0 1 * *" + workflow_dispatch: + +jobs: + Test: + strategy: + matrix: + os: [Ubuntu-Latest, macOS-Latest] + runs-on: ${{ matrix.os }} + + steps: + - name: Remove Python files + run: rm -fv /Library/Frameworks/Python.framework/Versions/3.12/bin/{2to3-3.12,idle3.12,pydoc3.12,python3.12,python3.12-config} + + - name: Skip mas + id: skip + if: ${{ matrix.os == 'macOS-Latest' }} + run: | + declare -r HOMEBREW_BUNDLE_MAS_SKIP="$(curl -s https://raw.githubusercontent.com/5ouma/dotfiles/${GITHUB_HEAD_REF:-HEAD}/data/Brewfile | sed -nE 's/^mas.* ([0-9]+)/\1/gp' | tr '\n' ' ')" + echo "HOMEBREW_BUNDLE_MAS_SKIP=$HOMEBREW_BUNDLE_MAS_SKIP" | tee -a "$GITHUB_OUTPUT" + + - name: Run setup + env: + SHELL: null + SETUP_SKIP_installDavinciResolve: true + SETUP_SKIP_loginGitHubCli: true + HOMEBREW_BUNDLE_MAS_SKIP: ${{ steps.skip.outputs.HOMEBREW_BUNDLE_MAS_SKIP }} + run: zsh <(curl -sL dotup.vercel.app/${GITHUB_HEAD_REF:-HEAD}) --yes + + - name: Launch New Login Shell + run: exec zsh -ilexc exit diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5cd3477e..b43569bf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,9 +11,6 @@ on: paths: - "setup" - ".github/workflows/test.yml" - schedule: - - cron: "0 0 1 * *" - workflow_dispatch: jobs: Test: @@ -34,32 +31,13 @@ jobs: [ "$(uname)" = 'Darwin' ] && brew install 5ouma/formula/mksei blacktop/tap/lporg || : - name: Run setup - if: ${{ github.event_name != 'schedule' }} env: + SHELL: null SETUP_SKIP_installApps: true SETUP_SKIP_installDavinciResolve: true SETUP_SKIP_loginGitHubCli: true SETUP_SKIP_restoreLaunchpad: true - run: | - export SHELL="$SHELL" - zsh <(curl -sL dotup.vercel.app/${GITHUB_HEAD_REF:-HEAD}) --yes - - - name: Skip mas - id: skip - if: ${{ github.event_name == 'schedule' && matrix.os == 'macOS-Latest' }} - run: | - declare -r HOMEBREW_BUNDLE_MAS_SKIP="$(curl -s https://raw.githubusercontent.com/5ouma/dotfiles/${GITHUB_HEAD_REF:-HEAD}/data/Brewfile | sed -nE 's/^mas.* ([0-9]+)/\1/gp' | tr '\n' ' ')" - echo "HOMEBREW_BUNDLE_MAS_SKIP=$HOMEBREW_BUNDLE_MAS_SKIP" | tee -a "$GITHUB_OUTPUT" - - - name: Run setup with Casks - if: ${{ github.event_name == 'schedule' }} - env: - SETUP_SKIP_installDavinciResolve: true - SETUP_SKIP_loginGitHubCli: true - HOMEBREW_BUNDLE_MAS_SKIP: ${{ steps.skip.outputs.HOMEBREW_BUNDLE_MAS_SKIP }} - run: | - export SHELL="$SHELL" - zsh <(curl -sL dotup.vercel.app/${GITHUB_HEAD_REF:-HEAD}) --yes + run: zsh <(curl -sL dotup.vercel.app/${GITHUB_HEAD_REF:-HEAD}) --yes - name: Launch New Login Shell run: exec zsh -ilexc exit