From e485e196129b353926f48551391351c9f7133b34 Mon Sep 17 00:00:00 2001 From: Gonzalo Pena-Castellanos Date: Thu, 26 May 2022 11:46:22 -0500 Subject: [PATCH 1/2] Add warning to master branch --- .github/workflows/caching-envs-example.yml | 20 +++-- README.md | 89 ++++++++++++---------- dist/setup/index.js | 10 ++- src/setup.ts | 9 ++- 4 files changed, 77 insertions(+), 51 deletions(-) diff --git a/.github/workflows/caching-envs-example.yml b/.github/workflows/caching-envs-example.yml index bb1d842d..f62c7ece 100644 --- a/.github/workflows/caching-envs-example.yml +++ b/.github/workflows/caching-envs-example.yml @@ -27,11 +27,11 @@ jobs: - name: Setup Mambaforge uses: conda-incubator/setup-miniconda@v2 with: - miniforge-variant: Mambaforge - miniforge-version: latest - activate-environment: anaconda-client-env - use-mamba: true - + miniforge-variant: Mambaforge + miniforge-version: latest + activate-environment: anaconda-client-env + use-mamba: true + - name: Get Date id: get-date run: echo "::set-output name=today::$(/bin/date -u '+%Y%m%d')" @@ -41,12 +41,18 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.CONDA }}/envs - key: conda-${{ runner.os }}--${{ runner.arch }}--${{ steps.get-date.outputs.today }}-${{ hashFiles('etc/example-environment-caching.yml') }}-${{ env.CACHE_NUMBER }} + key: + conda-${{ runner.os }}--${{ runner.arch }}--${{ + steps.get-date.outputs.today }}-${{ + hashFiles('etc/example-environment-caching.yml') }}-${{ + env.CACHE_NUMBER }} env: # Increase this value to reset cache if etc/example-environment.yml has not changed CACHE_NUMBER: 0 id: cache - name: Update environment - run: mamba env update -n anaconda-client-env -f etc/example-environment-caching.yml + run: + mamba env update -n anaconda-client-env -f + etc/example-environment-caching.yml if: steps.cache.outputs.cache-hit != 'true' diff --git a/README.md b/README.md index b0639cf0..29894efc 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ possibility of automatically activating the `test` environment on all shells. > Each of the examples below is discussed in a dedicated section below. | Documentation | Workflow Status | -| ----------------------------------------------- | ----------------------------------------------------------------| +| ----------------------------------------------- | --------------------------------------------------------------- | | [Basic usage](#example-1-basic-usage) | [![Basic Usage Status][ex1-badge]][ex1] | | [Other shells](#example-2-other-shells) | [![Other Shells Status][ex2-badge]][ex2] | | [Other options](#example-3-other-options) | [![Other Options Status][ex3-badge]][ex3] | @@ -575,61 +575,66 @@ as they are not included in the conda package cache. ### Caching environments -The first installation step should setup a Miniconda variant without -specifying a environment file. +The first installation step should setup a Miniconda variant without specifying +a environment file. ```yaml - - name: Setup Mambaforge - uses: conda-incubator/setup-miniconda@v2 - with: - miniforge-variant: Mambaforge - miniforge-version: latest - activate-environment: anaconda-client-env - use-mamba: true +- name: Setup Mambaforge + uses: conda-incubator/setup-miniconda@v2 + with: + miniforge-variant: Mambaforge + miniforge-version: latest + activate-environment: anaconda-client-env + use-mamba: true ``` -It's a good idea to refresh the cache every 24 hours to avoid inconsistencies -of package versions between the CI pipeline and local installations. -Here we ensure that this happens by adding the current date to the cache key. -You can remove the "Get Date" step below if you use a resolved environment file product of +It's a good idea to refresh the cache every 24 hours to avoid inconsistencies of +package versions between the CI pipeline and local installations. Here we ensure +that this happens by adding the current date to the cache key. You can remove +the "Get Date" step below if you use a resolved environment file product of `conda env export` or `conda list --explicit`. ```yaml - - name: Get Date - id: get-date - run: echo "::set-output name=today::$(/bin/date -u '+%Y%m%d')" - shell: bash +- name: Get Date + id: get-date + run: echo "::set-output name=today::$(/bin/date -u '+%Y%m%d')" + shell: bash - - name: Cache Conda env - uses: actions/cache@v2 - with: - path: ${{ env.CONDA }}/envs - key: conda-${{ runner.os }}--${{ runner.arch }}--${{ steps.get-date.outputs.today }}-${{ hashFiles('etc/example-environment-caching.yml') }}-${{ env.CACHE_NUMBER }} - env: - # Increase this value to reset cache if etc/example-environment.yml has not changed - CACHE_NUMBER: 0 - id: cache +- name: Cache Conda env + uses: actions/cache@v2 + with: + path: ${{ env.CONDA }}/envs + key: + conda-${{ runner.os }}--${{ runner.arch }}--${{ + steps.get-date.outputs.today }}-${{ + hashFiles('etc/example-environment-caching.yml') }}-${{ env.CACHE_NUMBER + }} + env: + # Increase this value to reset cache if etc/example-environment.yml has not changed + CACHE_NUMBER: 0 + id: cache ``` -Keep in mind that hashing `etc/example-environment-caching.yml` is not the -same as hashing a resolved environment file. `conda` (and `mamba`) resolves -the dependencies declared in the YAML file according to the packages -available on the channels at installation time. Since packages are updated -all the time, you will not see these changes reflected in the cache until -the key gets updated by date. +Keep in mind that hashing `etc/example-environment-caching.yml` is not the same +as hashing a resolved environment file. `conda` (and `mamba`) resolves the +dependencies declared in the YAML file according to the packages available on +the channels at installation time. Since packages are updated all the time, you +will not see these changes reflected in the cache until the key gets updated by +date. -**This means that the same environment file can make your tests pass locally -but fail on CI, or the other way around. In that case, reset the cache -manually to see if that leads to consistent results, or use a resolved -environment file.** +**This means that the same environment file can make your tests pass locally but +fail on CI, or the other way around. In that case, reset the cache manually to +see if that leads to consistent results, or use a resolved environment file.** -Finally, update the environment based on the environment file if the cache -does not exist. +Finally, update the environment based on the environment file if the cache does +not exist. ```yaml - - name: Update environment - run: mamba env update -n anaconda-client-env -f etc/example-environment-caching.yml - if: steps.cache.outputs.cache-hit != 'true' +- name: Update environment + run: + mamba env update -n anaconda-client-env -f + etc/example-environment-caching.yml + if: steps.cache.outputs.cache-hit != 'true' ``` ### Use a default shell diff --git a/dist/setup/index.js b/dist/setup/index.js index efc29f33..a82e72af 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -20561,6 +20561,7 @@ function setupMiniconda(inputs) { mambaInInstaller: false, condaConfig: Object.assign({}, inputs.condaConfig), }; + // Warn about the deprecation of the master branch yield core.group(`Creating bootstrap condarc file in ${constants.CONDARC_PATH}...`, conda.bootstrapConfig); const installerInfo = yield core.group("Ensuring installer...", () => installer.getLocalInstallerPath(inputs, options)); // The desired installer may change the options @@ -20607,6 +20608,13 @@ function setupMiniconda(inputs) { function run() { return __awaiter(this, void 0, void 0, function* () { try { + core.warning(` + The 'master' branch is deprecated and will be removed from the repository in the future. + + Please ensure your action is using the latest version, or point it to the 'main' branch. + + "conda-incubator/setup-minicando@main" + `); const inputs = yield core.group("Gathering Inputs...", input.parseInputs); yield setupMiniconda(inputs); } @@ -30000,7 +30008,7 @@ module.exports.safeLoad = safeLoad; /* 771 */ /***/ (function(module) { -module.exports = {"_args":[["cheerio@1.0.0-rc.3","/home/weg/projects/actions/setup-miniconda"]],"_from":"cheerio@1.0.0-rc.3","_id":"cheerio@1.0.0-rc.3","_inBundle":false,"_integrity":"sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA==","_location":"/cheerio","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"cheerio@1.0.0-rc.3","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/weg/projects/actions/setup-miniconda","author":{"name":"Matt Mueller","email":"mattmuelle@gmail.com","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"}; +module.exports = {"_args":[["cheerio@1.0.0-rc.3","/Users/gpenacastellanos/Dropbox (Personal)/develop/conda-incubator/setup-miniconda"]],"_from":"cheerio@1.0.0-rc.3","_id":"cheerio@1.0.0-rc.3","_inBundle":false,"_integrity":"sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA==","_location":"/cheerio","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"cheerio@1.0.0-rc.3","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":"/Users/gpenacastellanos/Dropbox (Personal)/develop/conda-incubator/setup-miniconda","author":{"name":"Matt Mueller","email":"mattmuelle@gmail.com","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 */ diff --git a/src/setup.ts b/src/setup.ts index 60412d08..daa3e170 100644 --- a/src/setup.ts +++ b/src/setup.ts @@ -21,7 +21,7 @@ async function setupMiniconda(inputs: types.IActionInputs): Promise { mambaInInstaller: false, condaConfig: { ...inputs.condaConfig }, }; - + // Warn about the deprecation of the master branch await core.group( `Creating bootstrap condarc file in ${constants.CONDARC_PATH}...`, conda.bootstrapConfig @@ -110,6 +110,13 @@ async function setupMiniconda(inputs: types.IActionInputs): Promise { */ async function run(): Promise { try { + core.warning(` + The 'master' branch is deprecated and will be removed from the repository in the future. + + Please ensure your action is using the latest version, or point it to the 'main' branch. + + "conda-incubator/setup-minicando@main" + `); const inputs = await core.group("Gathering Inputs...", input.parseInputs); await setupMiniconda(inputs); } catch (err) { From 90ceb23a34b1858858ab80f4b794525b835782c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Pe=C3=B1a-Castellanos?= Date: Fri, 11 Nov 2022 07:30:12 -0500 Subject: [PATCH 2/2] Update src/setup.ts Co-authored-by: Matt Thompson --- src/setup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/setup.ts b/src/setup.ts index daa3e170..0e298c34 100644 --- a/src/setup.ts +++ b/src/setup.ts @@ -115,7 +115,7 @@ async function run(): Promise { Please ensure your action is using the latest version, or point it to the 'main' branch. - "conda-incubator/setup-minicando@main" + "conda-incubator/setup-miniconda@main" `); const inputs = await core.group("Gathering Inputs...", input.parseInputs); await setupMiniconda(inputs);