Merge pull request #391 from david-ds/skasch/day05 #1041
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: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v1 | |
# Install missing language compilers and interpreters | |
# The default image natively supports bash, c/c++, go, java, julia, node, python, ruby, rust | |
# For new languages, see https://github.com/actions/virtual-environments/tree/d18c405/images/linux first | |
- uses: denolib/setup-deno@v2 | |
with: | |
deno-version: v0.x | |
- uses: jiro4989/setup-nim-action@v1 | |
with: | |
nim-version: 1.4.8 | |
- uses: goto-bus-stop/setup-zig@v1 | |
with: | |
version: 0.7.0 | |
# TODO: switch back to nocturlab/setup-vlang-action@v1 once https://github.com/nocturlab/setup-vlang-action/issues/72 is fixed | |
- name: Install vlang | |
run: | | |
wget -P /tmp https://github.com/vlang/v/releases/latest/download/v_linux.zip | |
unzip -d /tmp /tmp/v_linux.zip | |
sudo /tmp/v/v symlink | |
# We can not remove /tmp/v/ as /usr/local/bin/v needs some files in there | |
# Install missing dependencies | |
# Install npm packages if not cached | |
- name: cache-npm | |
uses: actions/cache@v1 | |
id: cache-npm | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }} | |
- name: deps-npm | |
if: steps.cache-npm.outputs.cache-hit != 'true' | |
run: npm install | |
# Install python packages if not cached | |
- name: cache-python | |
uses: actions/cache@v1 | |
id: cache-python | |
with: | |
path: ~/.local/lib/python3.8/site-packages | |
key: ${{ runner.os }}-${{ hashFiles('requirements.txt') }} | |
- name: deps-python | |
if: steps.cache-python.outputs.cache-hit != 'true' | |
run: sudo apt-get install python3-setuptools && python3 -m pip install --user wheel && python3 -m pip install --user -r requirements.txt | |
# Install ocaml packages if not cached | |
- name: install-esy | |
run: sudo npm install -g esy@0.6.11 --unsafe-perm | |
- name: cache-esy | |
uses: actions/cache@v2 | |
id: cache-esy | |
with: | |
path: _export | |
key: ${{ runner.os }}-esy-0.6.11-${{ hashFiles('esy.lock/index.json') }} | |
restore-keys: | | |
${{ runner.os }}-esy-0.6.11- | |
- name: install-esy-again-but-not-the-same | |
run: "esy install" | |
- name: import-esy | |
run: | | |
esy import-dependencies _export | |
rm -rf _export | |
- name: deps-esy | |
run: "esy build" | |
- name: export-esy | |
if: steps.cache-esy.outputs.cache-hit != 'true' | |
run: | | |
esy cleanup . | |
esy export-dependencies | |
# Install rust if not cached TODO | |
# - name: cache-cargo | |
# uses: actions/cache@v1 | |
# id: cache-cargo | |
# with: | |
# path: ~/.cargo/.bin | |
# key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }} | |
# - name: deps-cargo | |
# if: steps.cache-cargo.outputs.cache-hit != 'true' | |
# run: curl https://sh.rustup.rs -sSf -o rustup.sh && sh rustup.sh -y | |
# Build | |
- name: Build | |
run: ./build.sh |