Skip to content

Commit

Permalink
Merge pull request #95 from jaimergp/invalid-env-syntax-errors
Browse files Browse the repository at this point in the history
Fix CI for example 8
  • Loading branch information
goanpeca committed Nov 17, 2020
2 parents 86e62d7 + e6a2042 commit cbc8431
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
19 changes: 6 additions & 13 deletions .github/workflows/example-8.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Example 8: this should fail"
name: "Example 8: Catch invalid environment files"

on:
pull_request:
Expand All @@ -9,8 +9,8 @@ on:
- "master"

jobs:
example-1:
name: Ex1 (${{ matrix.python-version }}, ${{ matrix.os }})
example-8:
name: Ex8 (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -21,19 +21,12 @@ jobs:
- uses: actions/checkout@v2
- uses: ./
id: setup-miniconda
continue-on-error: true
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
environment-file: etc/example-faulty-environment.yml
- name: Check previous step failed
shell: bash
run: ${{ steps.setup-miniconda.conclusion == "failure" }}
- name: Conda info
shell: bash -l {0}
run: conda info
- name: Conda list
shell: pwsh
run: conda list
- name: Environment
shell: bash -l {0}
run: printenv | sort
if: always()
run: ${{ steps.setup-miniconda.outcome == 'failure' }}
18 changes: 17 additions & 1 deletion dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21344,6 +21344,13 @@ const IGNORED_WARNINGS = [
// old condas don't know what to do with these
`Key 'use_only_tar_bz2' is not a known primitive parameter.`,
];
/**
* warnings that should be errors
*/
const FORCED_ERRORS = [
// conda env create will ignore invalid sections and move on
`EnvironmentSectionNotValid`,
];
/**
* avoid spurious conda warnings before we have a chance to update them
*/
Expand All @@ -21360,6 +21367,15 @@ function execute(command) {
let options = {
errStream: new stream.Writable(),
listeners: {
stdout: (data) => {
const stringData = data.toString();
for (const forced_error of FORCED_ERRORS) {
if (stringData.includes(forced_error)) {
throw new Error(`"${command}" failed with "${forced_error}"`);
}
}
return data;
},
stderr: (data) => {
const stringData = data.toString();
for (const ignore of IGNORED_WARNINGS) {
Expand Down Expand Up @@ -29188,7 +29204,7 @@ module.exports = defaults;
/* 771 */
/***/ (function(module) {

module.exports = {"_from":"cheerio@^1.0.0-rc.2","_id":"[email protected]","_inBundle":false,"_integrity":"sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA==","_location":"/cheerio","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"cheerio@^1.0.0-rc.2","name":"cheerio","escapedName":"cheerio","rawSpec":"^1.0.0-rc.2","saveSpec":null,"fetchSpec":"^1.0.0-rc.2"},"_requiredBy":["/get-hrefs"],"_resolved":"https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.3.tgz","_shasum":"094636d425b2e9c0f4eb91a46c05630c9a1a8bf6","_spec":"cheerio@^1.0.0-rc.2","_where":"/Users/goanpeca/Dropbox (Personal)/develop/quansight/setup-miniconda/node_modules/get-hrefs","author":{"name":"Matt Mueller","email":"[email protected]","url":"mat.io"},"bugs":{"url":"https://github.com/cheeriojs/cheerio/issues"},"bundleDependencies":false,"dependencies":{"css-select":"~1.2.0","dom-serializer":"~0.1.1","entities":"~1.1.1","htmlparser2":"^3.9.1","lodash":"^4.15.0","parse5":"^3.0.1"},"deprecated":false,"description":"Tiny, fast, and elegant implementation of core jQuery designed specifically for the server","devDependencies":{"benchmark":"^2.1.0","coveralls":"^2.11.9","expect.js":"~0.3.1","istanbul":"^0.4.3","jquery":"^3.0.0","jsdom":"^9.2.1","jshint":"^2.9.2","mocha":"^3.1.2","xyz":"~1.1.0"},"engines":{"node":">= 0.6"},"files":["index.js","lib"],"homepage":"https://github.com/cheeriojs/cheerio#readme","keywords":["htmlparser","jquery","selector","scraper","parser","html"],"license":"MIT","main":"./index.js","name":"cheerio","repository":{"type":"git","url":"git://github.com/cheeriojs/cheerio.git"},"scripts":{"test":"make test"},"version":"1.0.0-rc.3"};
module.exports = {"_args":[["[email protected]","/home/jaime/devel/py/jaimergp/setup-miniconda"]],"_from":"[email protected]","_id":"[email protected]","_inBundle":false,"_integrity":"sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA==","_location":"/cheerio","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"[email protected]","name":"cheerio","escapedName":"cheerio","rawSpec":"1.0.0-rc.3","saveSpec":null,"fetchSpec":"1.0.0-rc.3"},"_requiredBy":["/get-hrefs"],"_resolved":"https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.3.tgz","_spec":"1.0.0-rc.3","_where":"/home/jaime/devel/py/jaimergp/setup-miniconda","author":{"name":"Matt Mueller","email":"[email protected]","url":"mat.io"},"bugs":{"url":"https://github.com/cheeriojs/cheerio/issues"},"dependencies":{"css-select":"~1.2.0","dom-serializer":"~0.1.1","entities":"~1.1.1","htmlparser2":"^3.9.1","lodash":"^4.15.0","parse5":"^3.0.1"},"description":"Tiny, fast, and elegant implementation of core jQuery designed specifically for the server","devDependencies":{"benchmark":"^2.1.0","coveralls":"^2.11.9","expect.js":"~0.3.1","istanbul":"^0.4.3","jquery":"^3.0.0","jsdom":"^9.2.1","jshint":"^2.9.2","mocha":"^3.1.2","xyz":"~1.1.0"},"engines":{"node":">= 0.6"},"files":["index.js","lib"],"homepage":"https://github.com/cheeriojs/cheerio#readme","keywords":["htmlparser","jquery","selector","scraper","parser","html"],"license":"MIT","main":"./index.js","name":"cheerio","repository":{"type":"git","url":"git://github.com/cheeriojs/cheerio.git"},"scripts":{"test":"make test"},"version":"1.0.0-rc.3"};

/***/ }),
/* 772 */
Expand Down
5 changes: 1 addition & 4 deletions src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,7 @@ async function execute(command: string): Promise<Result> {
const stringData = data.toString();
for (const forced_error of FORCED_ERRORS) {
if (stringData.includes(forced_error)) {
return {
ok: false,
error: new Error(`"${command}" failed with "${forced_error}"`),
};
throw new Error(`"${command}" failed with "${forced_error}"`);
}
}
return data;
Expand Down

0 comments on commit cbc8431

Please sign in to comment.