From 369d348a9bd884b22e3be2a3d6c470668e29991d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 17 Sep 2019 10:01:09 -0700 Subject: Add nightly, move haskell.yml -> ci.yml. --- .github/workflows/ci.yml | 114 ++++++++++++++++++++++++++++++++++++++++++ .github/workflows/haskell.yml | 114 ------------------------------------------ .github/workflows/nightly.yml | 101 +++++++++++++++++++++++++++++++++++++ 3 files changed, 215 insertions(+), 114 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/haskell.yml create mode 100644 .github/workflows/nightly.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..b68e3e043 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,114 @@ +name: CI tests + +on: + push: + paths: + - '*' + - '.github/workflows/haskell.yml' + - '!MANUAL.txt' + - '!/doc/*' + - '!/tools/*' + - '!/linux/*' + - '!/macos/*' + - '!/windows/*' + - '!/man/*' + - '!AUTHORS.md' + - '!BUGS' + - '!CONTRIBUTING.md' + - '!README.md' + - '!INSTALL.md' + - '!COPYRIGHT' + - '!COPYING.md' + - '!README.template' + - '!RELEASE_CHECKLIST' + - '!appveyor.yml' + - '!changelog' + +jobs: + linux: + + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + versions: + - ghc: '8.0.2' + cabal: '2.4' + - ghc: '8.2.2' + cabal: '2.4' + - ghc: '8.4.4' + cabal: '2.4' + - ghc: '8.6.5' + cabal: '2.4' +# - ghc: '8.8.1' +# cabal: '3.0' + steps: + - uses: actions/checkout@v1 + - name: Install recent cabal/ghc + run: | + sudo add-apt-repository ppa:hvr/ghc + sudo apt-get update + sudo apt-get install ghc-${{ matrix.versions.ghc }} cabal-install-${{ matrix.versions.cabal }} + - name: Install dependencies + run: | + export PATH=/opt/cabal/bin:/opt/ghc/bin:$PATH + cabal v2-update + cabal v2-build --dependencies-only --enable-tests --disable-optimization + - name: Build and test + run: | + export PATH=/opt/cabal/bin:/opt/ghc/bin:$PATH + cabal v2-install --enable-tests --run-tests --disable-optimization 2>&1 | tee build.log + # fail if warnings in local build + ! grep -q "[Ww]arning:" build.log + +# ARTIFACTS: Currently disabled. The executables are large and +# if we do produce artifacts, we should zip them. We also +# might consider doing this only nightly and stripping. +# The code is included below in case we want to re-enable it. +# +# - name: Install artifact +# run: | +# export PATH=/opt/cabal/bin:/opt/ghc/bin:$PATH +# mkdir -p ./artifacts +# for f in $(find dist-newstyle -name 'pandoc*' -type f -executable); do cp $f ./artifacts/; done +# - uses: actions/upload-artifact@master +# with: +# name: pandoc-linux +# path: ./artifacts/pandoc + + windows: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v1 + - name: Install stack + shell: cmd + run: | + choco install haskell-stack + - name: Install dependencies + run: | + stack update + stack test --dependencies-only --fast + - name: Build and test + shell: cmd + run: | + stack test --fast + + macos: + + runs-on: macOS-latest + + steps: + - uses: actions/checkout@v1 + - name: Install stack + run: | + curl -L https://get.haskellstack.org/stable/osx-x86_64.tar.gz -o stack.tar.gz + tar xzvf stack.tar.gz --strip-components=1 'stack*/stack' + - name: Install dependencies + run: | + ./stack update + ./stack test --dependencies-only --fast + - name: Build and test + run: | + ./stack test --fast diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml deleted file mode 100644 index c8b98bdf4..000000000 --- a/.github/workflows/haskell.yml +++ /dev/null @@ -1,114 +0,0 @@ -name: Haskell CI - -on: - push: - paths: - - '*' - - '.github/workflows/haskell.yml' - - '!MANUAL.txt' - - '!/doc/*' - - '!/tools/*' - - '!/linux/*' - - '!/macos/*' - - '!/windows/*' - - '!/man/*' - - '!AUTHORS.md' - - '!BUGS' - - '!CONTRIBUTING.md' - - '!README.md' - - '!INSTALL.md' - - '!COPYRIGHT' - - '!COPYING.md' - - '!README.template' - - '!RELEASE_CHECKLIST' - - '!appveyor.yml' - - '!changelog' - -jobs: - linux: - - runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - versions: - - ghc: '8.0.2' - cabal: '2.4' - - ghc: '8.2.2' - cabal: '2.4' - - ghc: '8.4.4' - cabal: '2.4' - - ghc: '8.6.5' - cabal: '2.4' -# - ghc: '8.8.1' -# cabal: '3.0' - steps: - - uses: actions/checkout@v1 - - name: Install recent cabal/ghc - run: | - sudo add-apt-repository ppa:hvr/ghc - sudo apt-get update - sudo apt-get install ghc-${{ matrix.versions.ghc }} cabal-install-${{ matrix.versions.cabal }} - - name: Install dependencies - run: | - export PATH=/opt/cabal/bin:/opt/ghc/bin:$PATH - cabal v2-update - cabal v2-build --dependencies-only --enable-tests - - name: Build and test - run: | - export PATH=/opt/cabal/bin:/opt/ghc/bin:$PATH - cabal v2-install --enable-tests --run-tests 2>&1 | tee build.log - # fail if warnings in local build - ! grep -q "[Ww]arning:" build.log - -# ARTIFACTS: Currently disabled. The executables are large and -# if we do produce artifacts, we should zip them. We also -# might consider doing this only nightly and stripping. -# The code is included below in case we want to re-enable it. -# -# - name: Install artifact -# run: | -# export PATH=/opt/cabal/bin:/opt/ghc/bin:$PATH -# mkdir -p ./artifacts -# for f in $(find dist-newstyle -name 'pandoc*' -type f -executable); do cp $f ./artifacts/; done -# - uses: actions/upload-artifact@master -# with: -# name: pandoc-linux -# path: ./artifacts/pandoc - - windows: - - runs-on: windows-latest - - steps: - - uses: actions/checkout@v1 - - name: Install stack - shell: cmd - run: | - choco install haskell-stack - - name: Install dependencies - run: | - stack update - stack test --dependencies-only - - name: Build and test - shell: cmd - run: | - stack test - - macos: - - runs-on: macOS-latest - - steps: - - uses: actions/checkout@v1 - - name: Install stack - run: | - curl -L https://get.haskellstack.org/stable/osx-x86_64.tar.gz -o stack.tar.gz - tar xzvf stack.tar.gz --strip-components=1 'stack*/stack' - - name: Install dependencies - run: | - ./stack update - ./stack test --dependencies-only - - name: Build and test - run: | - ./stack test diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 000000000..483df45a4 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,101 @@ +name: Nightly + +on: + schedule: + - cron: '30 3 * * *' + +jobs: + linux: + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Install recent cabal/ghc + run: | + sudo add-apt-repository ppa:hvr/ghc + sudo apt-get update + sudo apt-get install ghc-8.6.5 cabal-install-2.4 + - name: Install dependencies + run: | + export PATH=/opt/cabal/bin:/opt/ghc/bin:$PATH + cabal v2-update + cabal v2-build --dependencies-only --enable-tests . pandoc-citeproc + - name: Build and test + run: | + export PATH=/opt/cabal/bin:/opt/ghc/bin:$PATH + cabal v2-install --enable-tests --run-tests . pandoc-citeproc + - name: Install artifact + run: | + export ARTIFACTS=./pandoc-nightly-linux-$(date +%Y-%m%-d)-${GITHUB_SHA} + mkdir -p ${ARTIFACTS} + for f in $(find dist-newstyle -name 'pandoc*' -type f -executable); do cp $f ${ARTIFACTS}/; done + cp COPYRIGHT ${ARTIFACTS}/ + tar cvzf nightly-linux.tgz ${ARTIFACTS} + - uses: actions/upload-artifact@master + with: + name: nightly-linux-x86_64 + path: nightly-linux-x86_64.tgz + + windows: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v1 + - name: Install stack + shell: cmd + run: | + choco install haskell-stack + - name: Install dependencies + run: | + stack update + stack test --dependencies-only pandoc pandoc-citeproc + - name: Build and test + shell: cmd + run: | + stack install --test pandoc pandoc-citeproc + - name: Install artifact + run: | + for /f "delims=" %%a in ('stack path --local-bin-path') do @set BINPATH=%%a + set ARTIFACTS=pandoc-nightly-windows-$(date +%Y-%m%-d)-${GITHUB_SHA} + mkdir %ARTIFACTS% + copy %BINPATH%\pandoc.exe %ARTIFACTS%/ + copy %BINPATH%\pandoc-citeproc.exe %ARTIFACTS%/ + copy COPYRIGHT %ARTIFACTS%/COPYRIGHT.txt + 7z a nightly-windows.zip %ARTIFACTS% + - uses: actions/upload-artifact@master + with: + name: nightly-windows + path: nightly-windows.tgz + + macos: + + runs-on: macOS-latest + + steps: + - uses: actions/checkout@v1 + - name: Install stack + run: | + curl -L https://get.haskellstack.org/stable/osx-x86_64.tar.gz -o stack.tar.gz + tar xzvf stack.tar.gz --strip-components=1 'stack*/stack' + - name: Install dependencies + run: | + ./stack update + ./stack test --dependencies-only pandoc pandoc-citeproc + - name: Build and test + run: | + ./stack install --test pandoc pandoc-citeproc + - name: Install artifact + run: | + export ARTIFACTS=./pandoc-nightly-macos-$(date +%Y-%m%-d)-${GITHUB_SHA} + mkdir -p ${ARTIFACTS} + cp $HOME/.local/bin/pandoc ${ARTIFACTS}/ + cp $HOME/.local/bin/pandoc-citeproc ${ARTIFACTS}/ + cp COPYRIGHT ${ARTIFACTS}/ + for f in $(find dist-newstyle -name 'pandoc*' -type f -executable); do cp $f ${ARTIFACTS}/; done + zip -r nightly-macos.zip ${ARTIFACTS} + - uses: actions/upload-artifact@master + with: + name: nightly-macos + path: nightly-macos.zip + -- cgit v1.2.3