|
| 1 | +# This is a basic workflow to help you get started with Actions |
| 2 | + |
| 3 | +name: CI |
| 4 | + |
| 5 | +# Controls when the action will run. |
| 6 | +on: |
| 7 | + # Triggers the workflow on push or pull request events but only for the master branch |
| 8 | + push: |
| 9 | + branches: [ master ] |
| 10 | + pull_request: |
| 11 | + branches: [ master ] |
| 12 | + |
| 13 | + # Allows you to run this workflow manually from the Actions tab |
| 14 | + workflow_dispatch: |
| 15 | + |
| 16 | +# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| 17 | +jobs: |
| 18 | + test_stable: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + strategy: |
| 21 | + matrix: |
| 22 | + firefox: [ '73.0' ] |
| 23 | + include: |
| 24 | + - nim-version: 'stable' |
| 25 | + cache-key: 'stable' |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v2 |
| 28 | + - name: Checkout submodules |
| 29 | + run: git submodule update --init --recursive |
| 30 | + |
| 31 | + - name: Setup firefox |
| 32 | + uses: browser-actions/setup-firefox@latest |
| 33 | + with: |
| 34 | + firefox-version: ${{ matrix.firefox }} |
| 35 | + |
| 36 | + - name: Get Date |
| 37 | + id: get-date |
| 38 | + run: echo "::set-output name=date::$(date "+%Y-%m-%d")" |
| 39 | + shell: bash |
| 40 | + |
| 41 | + - name: Cache choosenim |
| 42 | + uses: actions/cache@v2 |
| 43 | + with: |
| 44 | + path: ~/.choosenim |
| 45 | + key: ${{ runner.os }}-choosenim-${{ matrix.cache-key }} |
| 46 | + |
| 47 | + - name: Cache nimble |
| 48 | + uses: actions/cache@v2 |
| 49 | + with: |
| 50 | + path: ~/.nimble |
| 51 | + key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }} |
| 52 | + |
| 53 | + - name: Install geckodriver |
| 54 | + run: | |
| 55 | + sudo apt-get -qq update |
| 56 | + sudo apt-get install autoconf libtool libsass-dev |
| 57 | + wget https://github.com/mozilla/geckodriver/releases/download/v0.29.1/geckodriver-v0.29.1-linux64.tar.gz |
| 58 | + mkdir geckodriver |
| 59 | + tar -xzf geckodriver-v0.29.1-linux64.tar.gz -C geckodriver |
| 60 | + export PATH=$PATH:$PWD/geckodriver |
| 61 | + |
| 62 | + - name: Install choosenim |
| 63 | + run: | |
| 64 | + export CHOOSENIM_CHOOSE_VERSION="${{ matrix.nim-version }}" |
| 65 | + curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh |
| 66 | + sh init.sh -y |
| 67 | + export PATH=$HOME/.nimble/bin:$PATH |
| 68 | + nimble refresh -y |
| 69 | + |
| 70 | + - name: Run tests |
| 71 | + run: | |
| 72 | + export PATH=$HOME/.nimble/bin:$PATH |
| 73 | + export MOZ_HEADLESS=1 |
| 74 | + nimble -y install |
| 75 | + nimble -y test |
0 commit comments