From f42c43d892cedda5a3be8148a3c78c924c38a791 Mon Sep 17 00:00:00 2001 From: Carlos Paniagua Date: Wed, 16 Oct 2024 18:29:21 -0400 Subject: [PATCH 1/2] feat: add workflow dispatch input for optional Julia package installation --- .github/workflows/test.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7776e1ac..f352819c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,9 +5,16 @@ on: - main tags: '*' pull_request: + workflow_dispatch: + inputs: + pkg_url: + description: 'URL to a IFT dev branch for Pkg installation' + required: false + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + jobs: test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} @@ -23,25 +30,40 @@ jobs: - x64 steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: '3.11' + - name: update pip run: python -m pip install -U pip + - name: install python deps run: python -m pip install -U -r requirements.txt + - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} + - uses: julia-actions/cache@v2 + + - name: Install Julia package from branch if URL provided + run: | + if [ -n "${{ github.event.inputs.pkg_url }}" ]; then + julia -e 'using Pkg; Pkg.add(PackageSpec(url="${{ github.event.inputs.pkg_url }}"))' + fi + - uses: julia-actions/julia-buildpkg@v1 env: PYTHON: python + - uses: julia-actions/julia-runtest@v1 env: PYTHON: python + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v4 with: files: lcov.info From e729ffc2f48f95cd9e71a97708af9b3ee88ca945 Mon Sep 17 00:00:00 2001 From: Carlos Paniagua Date: Wed, 16 Oct 2024 19:00:33 -0400 Subject: [PATCH 2/2] feat: add manual CI workflow with optional Julia package installation --- .github/workflows/manual_trigger.yml | 54 ++++++++++++++++++++++++++++ .github/workflows/test.yml | 22 ------------ 2 files changed, 54 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/manual_trigger.yml diff --git a/.github/workflows/manual_trigger.yml b/.github/workflows/manual_trigger.yml new file mode 100644 index 00000000..0ee7f3ef --- /dev/null +++ b/.github/workflows/manual_trigger.yml @@ -0,0 +1,54 @@ +name: Manual CI + +on: + workflow_dispatch: + inputs: + pkg_url: + description: 'URL to a branch for Pkg installation' + required: true + default: 'https://github.com/WilhelmusLab/IceFloeTracker.jl' + +jobs: + manual_test: + name: Julia Manual Test with Custom Dev Branch + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + version: + - '1.9' + arch: + - x64 + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: update pip + run: python -m pip install -U pip + + - name: install python deps + run: python -m pip install -U -r requirements.txt + + - uses: julia-actions/setup-julia@v2 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + + - uses: julia-actions/cache@v2 + + - name: Install Julia package from custom branch + run: | + julia -e 'using Pkg; Pkg.add(PackageSpec(url="${{ github.event.inputs.pkg_url }}"))' + + - uses: julia-actions/julia-buildpkg@v1 + env: + PYTHON: python + + - uses: julia-actions/julia-runtest@v1 + env: + PYTHON: python diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f352819c..7776e1ac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,16 +5,9 @@ on: - main tags: '*' pull_request: - workflow_dispatch: - inputs: - pkg_url: - description: 'URL to a IFT dev branch for Pkg installation' - required: false - concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} - jobs: test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} @@ -30,40 +23,25 @@ jobs: - x64 steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 with: python-version: '3.11' - - name: update pip run: python -m pip install -U pip - - name: install python deps run: python -m pip install -U -r requirements.txt - - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: julia-actions/cache@v2 - - - name: Install Julia package from branch if URL provided - run: | - if [ -n "${{ github.event.inputs.pkg_url }}" ]; then - julia -e 'using Pkg; Pkg.add(PackageSpec(url="${{ github.event.inputs.pkg_url }}"))' - fi - - uses: julia-actions/julia-buildpkg@v1 env: PYTHON: python - - uses: julia-actions/julia-runtest@v1 env: PYTHON: python - - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v4 with: files: lcov.info