From 892eb906687bbf01839ce1806c2f13e95b816507 Mon Sep 17 00:00:00 2001 From: Neko Box Coder Date: Sun, 1 Dec 2024 14:19:07 +0000 Subject: [PATCH] Attempt to add CI --- .../install-plugins.yml | 49 +++++++++++++++++++ .github/workflows/trigger-test.yml | 17 +++++++ 2 files changed, 66 insertions(+) create mode 100644 .github-scheduled-workflows/install-plugins.yml create mode 100644 .github/workflows/trigger-test.yml diff --git a/.github-scheduled-workflows/install-plugins.yml b/.github-scheduled-workflows/install-plugins.yml new file mode 100644 index 0000000..a4d4ee3 --- /dev/null +++ b/.github-scheduled-workflows/install-plugins.yml @@ -0,0 +1,49 @@ +name: "Delayed Plugin Installation" +on: + schedule: + - cron: '*/30 * * * *' # Run every 30 minutes + +jobs: + install-plugins: + runs-on: ubuntu-latest + strategy: + matrix: + channel: ['main', 'stable'] + + steps: + - name: Install Micro editor from nightly + run: | + wget https://github.com/zyedidia/micro/releases/download/nightly/micro-nightly-linux64.tar.gz + tar xzf micro-nightly-linux64.tar.gz + + - name: Configure Micro plugin channel + run: | + mkdir -p ~/.config/micro + echo '{ + "pluginchannels": [ + "https://raw.githubusercontent.com/Neko-Box-Coder/unofficial-plugin-channel/${{ matrix.channel }}/channel.json" + ] + }' > ~/.config/micro/settings.json + + - name: Install plugins + run: | + ./micro-*/micro -plugin install acme + ./micro-*/micro -plugin install xonsh + ./micro-*/micro -plugin list + + - name: Check plugin installation + run: | + if ! ./micro-*/micro -plugin list | grep -q "acme"; then + echo "Acme plugin installation failed for ${{ matrix.channel }} channel" + exit 1 + fi + if ! ./micro-*/micro -plugin list | grep -q "xonsh"; then + echo "Xonsh plugin installation failed for ${{ matrix.channel }} channel" + exit 1 + fi + + - name: Remove scheduled job + if: always() # Run this step regardless of previous steps' success/failure + uses: cardinalby/unschedule-job-action@v1 + with: + ghToken: ${{ secrets.WORKFLOWS_TOKEN }} diff --git a/.github/workflows/trigger-test.yml b/.github/workflows/trigger-test.yml new file mode 100644 index 0000000..c59dcc9 --- /dev/null +++ b/.github/workflows/trigger-test.yml @@ -0,0 +1,17 @@ +name: Trigger Test Install Micro Plugins + +on: + push: + branches: + - main + workflow_dispatch: # Allow manual trigger + +jobs: + schedule-install: + runs-on: ubuntu-latest + steps: + - name: Schedule delayed job + uses: cardinalby/schedule-job-action@v1 + with: + ghToken: ${{ secrets.WORKFLOWS_TOKEN }} + templateYmlFile: '.github-scheduled-workflows/install-plugins.yml'