Skip to content

Commit

Permalink
ci: esy i in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Et7f3 committed Jun 27, 2020
1 parent f85b6b2 commit e6ac59e
Showing 1 changed file with 1 addition and 165 deletions.
166 changes: 1 addition & 165 deletions .github/workflows/validate-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,8 @@ jobs:
esy install -P bench
esy install -P doc
esy install -P js
esy install -P examples
git diff --exit-code || (git add *lock; git commit -m "Update lockdir, ")
- 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-macos
uses: actions/cache@v1.1.2
with:
path: ${{ steps.print_esy_cache.outputs.esy_cache }}
key: macos-latest-${{ hashFiles('**/index.json') }}
restore-keys: |
macos-latest-
- name: Build dependencies
if: steps.deps-cache-macos.outputs.cache-hit != 'true'
run: esy build-dependencies --release
- name: Generate opam files
run: |
esy build dune build @check
git diff --exit-code || ([[ "$(git log -1 --pretty=format:'%an')" != "Github Runner" ]] && git commit -am "opam, " || git commit --amend -am "$(git log -1 --pretty=format:'%s')opam, ")
- name: format sources files
run: |
esy format || ([[ "$(git log -1 --pretty=format:'%an')" != "Github Runner" ]] && git commit -am "format, " || git commit --amend -am "$(git log -1 --pretty=format:'%s')format, ")
- name: Push if it is not up to date
if: github.event_name != 'pull_request'
run: |
Expand All @@ -73,147 +53,3 @@ jobs:
body: "I have updated your lock dirs and formatted the code.\n" +
"Please @" + context.actor + " pull the last commit before pushing any more changes."
});
doc:
name: Push docs to GitHub's Pages
runs-on: macos-latest
steps:
- uses: actions/setup-node@v1.4.2
with:
node-version: 12
- uses: actions/checkout@v2
- name: Install esy
run: npm install -g esy
- run: brew install coreutils
- name: Solve doc dependencies
run: esy @doc 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-macos
uses: actions/cache@v1.1.2
with:
path: ${{ steps.print_esy_cache.outputs.esy_cache }}
key: macos-latest-${{ hashFiles('**/index.json') }}
restore-keys: |
macos-latest-
- name: Install doc dependencies
if: steps.deps-cache-macos.outputs.cache-hit != 'true'
run: esy @doc build-dependencies --release
- name: Print docs path
id: print_docs_path
run: node .github/workflows/print_docs_path.js
- name: Generate docs
run: esy @doc build --release
- run: ls ./_esy
- run: ls ./_esy/doc
- run: ls ./_esy/doc/store
- run: ls ./_esy/doc/store/b
- run: ls ./_esy/doc/store/b/revery-*
- run: ls ./_esy/doc/store/b/revery-*/default
- run: ls ./_esy/doc/store/b/revery-*/default/_doc
- run: ls ./_esy/doc/store/b/revery-*/default/_doc/_html
- run: echo $GITHUB_ACTOR $DOC_PATH
env:
DOC_PATH: ${{ steps.print_docs_path.outputs.docs_path }}
- run: find . -name "*.html"
- run: ls ./$DOC_PATH
env:
DOC_PATH: ${{ steps.print_docs_path.outputs.docs_path }}
- name: Deploy docs
if: github.ref == 'refs/heads/master'
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
CLEAN: true
FOLDER: ${{ steps.print_docs_path.outputs.docs_path }}

build_docker:
name: Build inside a docker
runs-on: ubuntu-latest
strategy:
# If we have many bug we can test on all plateform
fail-fast: false
matrix:
os: [archlinux, centos]
steps:
- uses: actions/checkout@v2
- run: docker build -t ${{ matrix.os }} scripts/docker/${{ matrix.os }}
- name: Create esy store
run: mkdir ~/.esy
- run: docker run --rm --volume $(pwd):/revery --volume ~/.esy:/esy/store ${{ matrix.os }} bash -c "cd /revery && esy install --prefix-path=/esy/store"
- 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.1.2
with:
path: ${{ steps.print_esy_cache.outputs.esy_cache }}
key: ${{ matrix.os }}-${{ hashFiles('**/index.json') }}
restore-keys: |
${{ matrix.os }}-
- name: Build release dependencies
if: steps.deps-cache.outputs.cache-hit != 'true'
run: docker run --rm --volume $(pwd):/revery --volume ~/.esy:/esy/store ${{ matrix.os }} bash -c "cd /revery && esy build-dependencies --release --prefix-path=/esy/store"
- name: Build project in release
run: docker run --rm --volume $(pwd):/revery --volume ~/.esy:/esy/store ${{ matrix.os }} bash -c "cd /revery && esy build --release --prefix-path=/esy/store"
- name: Build test/dev dependencies
run: docker run --rm --volume $(pwd):/revery --volume ~/.esy:/esy/store ${{ matrix.os }} bash -c "cd /revery && esy build-dependencies --prefix-path=/esy/store"

build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
# If we have many bug we can test on all plateform
fail-fast: false
matrix:
os: [windows-2016, ubuntu-latest, macos-latest]
steps:
- uses: actions/setup-node@v1.4.2
with:
node-version: 12
- uses: actions/checkout@v2
- name: Install esy
run: npm install -g esy
- name: Install native dependencies on ubuntu-latest
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-utils mesa-utils-extra ragel libgtk-3-dev nasm
- 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
if: matrix.os != 'windows-latest'
id: deps-cache-non-win
uses: actions/cache@v1.1.2
with:
path: ${{ steps.print_esy_cache.outputs.esy_cache }}
key: ${{ matrix.os }}-${{ hashFiles('**/index.json') }}
restore-keys: |
${{ matrix.os }}-
- name: Try to restore dependencies cache
if: matrix.os == 'windows-latest'
id: deps-cache-win
uses: actions/cache@v1.1.2
with:
path: ${{ steps.print_esy_cache.outputs.esy_cache }}
key: ${{ matrix.os }}-${{ hashFiles('**\index.json') }}
restore-keys: |
${{ matrix.os }}-
- name: Build dependencies
if: steps.deps-cache-win.outputs.cache-hit != 'true' && steps.deps-cache-non-win.outputs.cache-hit != 'true'
run: esy build-dependencies --release
- name: Build
run: esy build --release
- name: Build test/dev dependencies
if: steps.deps-cache-win.outputs.cache-hit != 'true' && steps.deps-cache-non-win.outputs.cache-hit != 'true'
run: |
esy build-dependencies
# We might have used restore-keys
esy cleanup .

0 comments on commit e6ac59e

Please sign in to comment.