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

import and call the env analysis script #4

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
4b21130
import the script
keewis Nov 11, 2024
3d9eff3
list the dependencies
keewis Nov 11, 2024
3b4c189
call the script from within the action
keewis Nov 11, 2024
416fbfe
explicitly specify the shell
keewis Nov 11, 2024
79ba941
Merge branch 'main' into script
keewis Nov 11, 2024
d398fac
quote the `envs-path` variable
keewis Nov 11, 2024
9f59968
try setting the input type of env-paths
keewis Nov 11, 2024
c0f3614
try serializing to json
keewis Nov 11, 2024
670a623
quote the input
keewis Nov 11, 2024
80652c1
missing shell
keewis Nov 11, 2024
70b826c
correct the input name
keewis Nov 11, 2024
23fcf82
print the decoded paths
keewis Nov 11, 2024
689c049
typo
keewis Nov 11, 2024
5773e7c
use the right function names
keewis Nov 11, 2024
a2b494c
unquote
keewis Nov 11, 2024
03b5e25
try using `join`
keewis Nov 11, 2024
1f48cd0
remove debug step
keewis Nov 11, 2024
9094fb2
allow expected failures
keewis Nov 11, 2024
f823a9a
add test env files
keewis Nov 11, 2024
56649b6
compare strings instead
keewis Nov 11, 2024
2b90a42
pass expected failure as a list
keewis Nov 11, 2024
5bb582c
another failing example
keewis Nov 11, 2024
a45662b
show the status of the current dir
keewis Nov 11, 2024
b470c76
more debugging
keewis Nov 11, 2024
2866cda
print the content of `envs`
keewis Nov 11, 2024
906112e
rename `env1`
keewis Nov 11, 2024
4c0f2d4
use a existing version of `pandas`
keewis Nov 11, 2024
211a609
use an existing version of `packaging`
keewis Nov 11, 2024
132fef7
enforce a column width of 120
keewis Nov 11, 2024
16ba62b
proper syntax
keewis Nov 11, 2024
7cd86c1
try setting in a different place
keewis Nov 11, 2024
f35f7a6
remove debug step
keewis Nov 11, 2024
d2afd5d
enforce colors
keewis Nov 11, 2024
51b7209
remove the `always`
keewis Nov 11, 2024
88a99f2
split up into smaller steps
keewis Nov 11, 2024
9d16bbe
don't cancel in-progress jobs when others fail
keewis Nov 11, 2024
613b72e
cancel duplicate workflow runs
keewis Nov 11, 2024
a4c96e1
continue if the action fails
keewis Nov 11, 2024
e99ab75
more output
keewis Nov 11, 2024
1854f7e
tests for `Spec.parse`
keewis Nov 11, 2024
6663062
always set the pass status
keewis Nov 11, 2024
359658c
check the output of the status functions
keewis Nov 11, 2024
3f22778
consolidate into a single step
keewis Nov 11, 2024
f8632e9
continue on error
keewis Nov 11, 2024
8aac731
some more adjustments
keewis Nov 11, 2024
3ccaf95
fix the `xfail`
keewis Nov 11, 2024
2ba79be
Apply suggestions from code review
keewis Nov 11, 2024
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
42 changes: 41 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@ on:
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
ci:
name: tests
runs-on: [ubuntu-latest]
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]

Expand All @@ -36,16 +41,51 @@ jobs:
runs-on: [ubuntu-latest]

strategy:
fail-fast: false
matrix:
env-paths:
- ["envs/env1.yaml"]
- ["envs/env2.yaml"]
- ["envs/env1.yaml", "envs/env2.yaml"]
expected-failure: ["false"]
include:
- env-paths: ["envs/failing-env1.yaml"]
expected-failure: "true"
- env-paths: ["envs/env1.yaml", "envs/failing-env1.yaml"]
expected-failure: "true"

steps:
- name: clone the repository
uses: actions/checkout@v4
- name: run action
uses: ./
id: action-run
continue-on-error: true
with:
environment-paths: ${{ matrix.env-paths }}
environment-paths: "${{ toJSON(matrix.env-paths) }}"
- name: detect outcome
if: always()
shell: bash -l {0}
run: |
if [[ "${{ steps.action-run.outcome }}" == "success" && ${{ matrix.expected-failure }} == "true" ]]; then
# unexpected pass
echo "workflow xpassed"
export STATUS=1
elif [[ "${{ steps.action-run.outcome }}" == "failure" && ${{ matrix.expected-failure }} == "false" ]]; then
# unexpected failure
echo "workflow failed"
export STATUS=2
elif [[ "${{ steps.action-run.outcome }}" == "success" && ${{ matrix.expected-failure }} == "false" ]]; then
# normal pass
echo "workflow passed"
export STATUS=0
elif [[ "${{ steps.action-run.outcome }}" == "failure" && ${{ matrix.expected-failure }} == "true" ]]; then
# expected failure
echo "workflow xfailed"
export STATUS=0
else
# cancelled
echo "workflow cancelled"
export STATUS=3
fi
exit $STATUS
15 changes: 14 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,21 @@ inputs:
description: >-
The paths to the environment files
required: True
type: string
outputs: {}

runs:
using: "composite"
steps: {}

steps:
- name: install dependencies
shell: bash -l {0}
run: |
python -m pip install -r requirements.txt
- name: analyze environments
shell: bash -l {0}
env:
COLUMNS: 120
FORCE_COLOR: 3
run: |
python minimum_versions.py ${{ join(fromJSON(inputs.environment-paths), ' ') }}
7 changes: 7 additions & 0 deletions envs/env1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
channels:
- conda-forge
dependencies:
- python=3.10
- numpy=1.24
- pandas=2.1
- packaging=23.1
8 changes: 8 additions & 0 deletions envs/env2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
channels:
- conda-forge
dependencies:
- python=3.10
- numpy=1.23
- xarray=2023.10.0
- dask=2023.10.0
- distributed=2023.10.0
6 changes: 6 additions & 0 deletions envs/failing-env1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
channels:
- conda-forge
dependencies:
- python=3.11
- numpy=2.1
- pandas=2.2.1
Loading
Loading