diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b774a33c5..d49370512 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,9 +21,31 @@ jobs: - "~> 4.0" steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: "Set up Ruby ${{ matrix.ruby_version }}" uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby_version }} bundler-cache: true + - name: Unit Tests + run: bundle exec rspec + + node: + name: "Test Frontend (Node ${{ matrix.node_version }})" + runs-on: "ubuntu-latest" + strategy: + fail-fast: false + matrix: + node_version: ["12"] + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: "Set up Node ${{ matrix.node_version }}" + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node_version }} + cache: "yarn" + - name: Install Dependencies + run: yarn install + - name: Build frontend and run tests + run: bash script/build diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 97f5a5a16..000000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: ruby -rvm: 2.4 -before_install: - - nvm install 8 - - gem update --system 3.0.6 --no-document -install: script/bootstrap -script: script/cibuild -cache: - bundler: true - yarn: true - directories: - - node_modules -env: - matrix: - - TEST_SUITE=node - - TEST_SUITE=ruby JEKYLL_VERSION="~> 3.8.6" - - TEST_SUITE=ruby JEKYLL_VERSION="~> 3.9" - - TEST_SUITE=ruby JEKYLL_VERSION="~> 4.0" -after_success: - - npm run test:cover:CI -branches: - only: - - master diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index f26fcf890..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,43 +0,0 @@ -environment: - nodejs_version: 8 - RACK_ENV: test - JEKYLL_LOG_LEVEL: warn - RUBY_VERSION: 25 - matrix: - - TEST_SUITE: node - - TEST_SUITE: ruby - JEKYLL_VERSION: "~> 3.8.6" - - TEST_SUITE: ruby - JEKYLL_VERSION: "~> 3.9" - - TEST_SUITE: ruby - JEKYLL_VERSION: "~> 4.0" - -install: - - set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH% - - ps: Install-Product node $env:nodejs_version - - gem update --system --no-document - - bundle config --local path vendor/bundle - - sh script/bootstrap - -build: off - -branches: - only: - - master - -before_test: - - node --version - - npm --version - - ruby -v - - gem -v - - bundle -v - -test_script: - - sh script/cibuild - -cache: - - vendor/bundle - - 'node_modules -> package.json' # invalidate cache if package.json changes - -init: - - git config --global core.autocrlf true diff --git a/spec/jekyll-admin/custom_integration_spec.rb b/spec/jekyll-admin/custom_integration_spec.rb index 24192eb38..6ee389782 100644 --- a/spec/jekyll-admin/custom_integration_spec.rb +++ b/spec/jekyll-admin/custom_integration_spec.rb @@ -27,7 +27,7 @@ sleep 3 end - after { Open3.capture2e(*stop_command) } + after { Open3.capture2e(*stop_command) } unless ENV["GITHUB_ACTION"] context "Jekyll site" do let(:path) { "/" } diff --git a/spec/jekyll-admin/integration_spec.rb b/spec/jekyll-admin/integration_spec.rb index 7af4f0b9f..dde567443 100644 --- a/spec/jekyll-admin/integration_spec.rb +++ b/spec/jekyll-admin/integration_spec.rb @@ -16,7 +16,7 @@ sleep 3 end - after { Open3.capture2e(*stop_command) } + after { Open3.capture2e(*stop_command) } unless ENV["GITHUB_ACTION"] context "Jekyll site" do let(:path) { "/" } diff --git a/spec/jekyll-admin/server/data_spec.rb b/spec/jekyll-admin/server/data_spec.rb index 313662d46..43dbf805f 100644 --- a/spec/jekyll-admin/server/data_spec.rb +++ b/spec/jekyll-admin/server/data_spec.rb @@ -31,7 +31,7 @@ def app it "gets the index" do get "/data" expect(last_response).to be_ok - expect(last_response_parsed[2]).to eql(base_response) + expect(last_response_parsed.find { |file| file["slug"] == "data_file" }).to eql(base_response) end it "gets an individual data file" do diff --git a/spec/jekyll-admin/server/theme_spec.rb b/spec/jekyll-admin/server/theme_spec.rb index b0ecba1e2..f1890bcab 100644 --- a/spec/jekyll-admin/server/theme_spec.rb +++ b/spec/jekyll-admin/server/theme_spec.rb @@ -57,7 +57,9 @@ def app get "/theme/_layouts" expect(last_response).to be_ok expect(last_response_parsed["name"]).to eq("_layouts") - expect(last_response_parsed["entries"].first).to eq(expected) + expect( + last_response_parsed["entries"].find { |layout| layout["name"] == "default.html" } + ).to eq(expected) end it "returns subdirectories" do @@ -69,7 +71,9 @@ def app } get "/theme/assets/images" expect(last_response).to be_ok - expect(last_response_parsed["entries"].first).to eq(expected) + expect( + last_response_parsed["entries"].find { |img| img["name"] == "icon-dark.png" } + ).to eq(expected) end end