Bump actions/download-artifact from 1 to 4.1.7 in /.github/workflows #33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Validate Pull Request | |
on: [pull_request] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macOS-latest, windows-latest] | |
steps: | |
# Steps needed for esy | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 12 | |
- uses: actions/checkout@v1 | |
- name: Install esy | |
run: npm install -g esy | |
# Install and build | |
- name: Try to restore install cache | |
uses: actions/cache@v1 | |
with: | |
path: ~/.esy/source | |
key: source-${{ matrix.os }}-${{ hashFiles('**/index.json') }} | |
# restore keys are not used for install sources because esy cleanup does not remove those. | |
# Therefore the esy/source directory would grow infinitely | |
- name: Install dependencies | |
run: esy install | |
- name: Print esy cache | |
id: print_esy_cache | |
run: node .github/workflows/print_esy_cache.js | |
- name: Try to restore dependencies cache | |
id: deps-cache | |
uses: actions/cache@v1 | |
with: | |
path: ${{ steps.print_esy_cache.outputs.esy_cache }} | |
key: ${{ matrix.os }}-4.09-${{ hashFiles('**/index.json') }} | |
- name: Build | |
run: esy build | |
lint: | |
name: lint lockdir | |
runs-on: macos-latest | |
steps: | |
# Steps needed for esy | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 12 | |
- uses: actions/checkout@v1 | |
- name: Install esy | |
run: npm install -g esy | |
# Install and build | |
- name: Try to restore install cache | |
uses: actions/cache@v1 | |
with: | |
path: ~/.esy/source | |
key: source-${{ matrix.os }}-${{ hashFiles('**/index.json') }} | |
# restore keys are not used for install sources because esy cleanup does not remove those. | |
# Therefore the esy/source directory would grow infinitely | |
- name: Update lockdir | |
run: | | |
esy install | |
git add esy.lock | |
- name: Print esy cache | |
id: print_esy_cache | |
run: node .github/workflows/print_esy_cache.js | |
- name: Try to restore dependencies cache | |
id: deps-cache | |
uses: actions/cache@v1 | |
with: | |
path: ${{ steps.print_esy_cache.outputs.esy_cache }} | |
key: build-${{ matrix.os }}-${{ hashFiles('**/index.json') }} | |
restore-keys: build-${{ matrix.os }}- | |
- name: Generate opam files | |
run: | | |
esy dune build @check | |
git add *opam | |
- name: format sources files | |
run: | | |
esy fmt | |
git add "*.ml" | |
- name: Update version in packages | |
run: | | |
node .github/workflows/update_package_version.js | |
git add "*.json" | |
- name: Check that lock directory are up-to-date. | |
run: git diff --exit-code --cached | |
- name: Push if it is not | |
if: failure() | |
run: | | |
git remote set-url --push origin https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY | |
git config user.name "Github Runner" | |
git config user.email "[email protected]" | |
git commit -am "Update lockdir" | |
git status | |
git push origin HEAD:$GITHUB_HEAD_REF | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Display status should be clean | |
run: git status | |
if: success() | |
- uses: actions/[email protected] | |
if: failure() | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
github.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: `I have updated your lock dirs and formatted the code. @${context.actor} please pull the last commit before pushing any more changes.` | |
}); |