From 26e1cdacb847d22b43aa257cf75ec785aeada3de Mon Sep 17 00:00:00 2001 From: Dhruv Thakur <13575379+dhth@users.noreply.github.com> Date: Sat, 24 Aug 2024 22:35:15 +0200 Subject: [PATCH] ci: add separate run action --- .github/workflows/build.yml | 13 +------------ .github/workflows/run.yml | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/run.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 934cbdf..1c91c61 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,11 +17,7 @@ env: jobs: build: - name: build - strategy: - matrix: - os: [ubuntu-latest, macos-latest] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Go @@ -32,10 +28,3 @@ jobs: run: go build -v ./... - name: go test run: go test -v ./... - - name: run omm - run: | - go build . - cat assets/sample-tasks.txt | ./omm import - ./omm 'test: a task' - ./omm tasks - ./.github/scripts/checknumtasks.sh "$(./omm tasks | wc -l | xargs)" 11 diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml new file mode 100644 index 0000000..5d7960d --- /dev/null +++ b/.github/workflows/run.yml @@ -0,0 +1,37 @@ +name: run + +on: + push: + branches: [ "main" ] + pull_request: + paths: + - "go.*" + - "**/*.go" + - ".github/workflows/*.yml" + +permissions: + contents: read + +env: + GO_VERSION: '1.22.5' + +jobs: + run: + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + - name: build + run: go build . + - name: run + run: | + cat assets/sample-tasks.txt | ./omm import + ./omm 'test: a task' + ./omm tasks + ./.github/scripts/checknumtasks.sh "$(./omm tasks | wc -l | xargs)" 11