Skip to content

Commit

Permalink
Fix Windows CI (#904)
Browse files Browse the repository at this point in the history
Implement the GitHub Actions recommended solution following an update to their infrastructure. The expected result is to drop failure rate from 100% down to 10%. See actions/runner-images#5949 (comment) for details.
Upgrade CI Windows from Server 2019 to Server 2022.
Speed up Linux CI.
Test on MongoDB v5 instead of v4 on Linux.
  • Loading branch information
MattiSG authored Aug 24, 2022
2 parents 8411809 + bde8325 commit 881d899
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
test:
strategy:
matrix:
operating_system: [ ubuntu-latest, windows-2019 ]
operating_system: [ ubuntu-latest, windows-latest ]
fail-fast: false # run tests on other operating systems even if one fails

runs-on: ${{ matrix.operating_system }}
Expand All @@ -23,26 +23,26 @@ jobs:
git config --global user.email 'bot@opentermsarchive.org'
git config --global core.autocrlf false
- uses: actions/checkout@v2
- name: Start MongoDB (UNIX)
if: runner.os != 'Windows'
run: |
mkdir /tmp/test-database
mongod --dbpath /tmp/test-database --fork --logpath /tmp/mongodb-log
- name: Start MongoDB (Windows)
if: runner.os == 'Windows'
run: |
Set-Service MongoDB -StartupType Automatic
Start-Service -Name MongoDB
- uses: actions/setup-node@v2
with:
node-version: 16
- name: Install and Start MongoDB (ubuntu)
if: matrix.operating_system == 'ubuntu-latest'
uses: supercharge/mongodb-github-action@1.7.0
with:
mongodb-version: 4.4
- name: Install and Start MongoDB (windows)
if: matrix.operating_system == 'windows-2019'
uses: crazy-max/ghaction-chocolatey@v1.6.0
with:
args: install mongodb
- run: npm ci
- run: npm test

validate_declarations:
strategy:
matrix:
operating_system: [ubuntu-latest, windows-2019]
operating_system: [ ubuntu-latest, windows-latest ]
fail-fast: false # run tests on other operating systems even if one fails

runs-on: ${{ matrix.operating_system }}
Expand Down

0 comments on commit 881d899

Please # to comment.