Skip to content

Commit

Permalink
Initial CI using GitHub actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryzhyk committed Jun 16, 2021
1 parent 295a09f commit 7582db2
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push to any branch
push:
# Triggers the workflow on pull request events but only for the master branch
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

release:
types: [ published ]

defaults:
run:
shell: bash

jobs:
build_and_test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

env:
DDLOG_TEST_PROGRESS: 1
CLASSPATH: ${{ github.workspace }}/flatbuffers/java

steps:
- run: echo "Build triggered by GitHub event ${GITHUB_EVENT_NAME}"
- uses: actions/checkout@v2
- if: ${{ runner.os == 'Linux' }}
run: (rm "${HOME}/.cargo" && mv /usr/share/rust/.cargo "${HOME}/")
# flatc gets installed to '${HOME}/.local/bin'.
- run: echo "${HOME}/.local/bin" >> "${GITHUB_PATH}"
- run: echo "${HOME}/.cargo/bin" >> "${GITHUB_PATH}"
- run: echo "${PATH}"
- run: export DIST_NAME=ddlog-${{ github.ref }}-$(date +'%Y%m%d%H%M%S')-${{ runner.os }}
- run: ./tools/install-flatbuf.sh
- run: stack --no-terminal test --ta '-p tutorial'
- run: stack --no-terminal install
- name: build distro
if: ${{ github.event_name == 'release' }}
run: ./build_distro.sh
- name: Upload Release Asset
if: ${{ github.event_name == 'release' }}
uses: alexellis/upload-assets@0.3.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_paths: "./${{ env.DIST_NAME }}.tar.gz"

# Run build-distro.sh if the build was triggered by a 'release' event.
#build_distro:
# needs: build_and_test
# strategy:
# matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
# if: ${{ github.event_name == 'release' }}
# steps:
# - run: export DIST_NAME=ddlog-${{ github.ref }}-$(date +'%Y%m%d%H%M%S')-${{ runner.os }}
# - run: ./build_distro.sh

0 comments on commit 7582db2

Please sign in to comment.