Fix CI and Dockerfile #96
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test-Release | |
| on: [push, pull_request] | |
| jobs: | |
| tests: | |
| name: "Tests (webextension, interfacer: unit, tty, http-server)" | |
| runs-on: ubuntu-latest | |
| env: | |
| GOPATH: ${{ github.workspace }} | |
| GOBIN: ${{ github.workspace }}/bin | |
| outputs: | |
| is_new_version: ${{ steps.check_versions.outputs.is_new_version }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'interfacer/go.mod' | |
| - name: Setup node | |
| uses: actions/setup-node@v4 | |
| - name: Install Firefox | |
| uses: browser-actions/setup-firefox@latest | |
| with: | |
| firefox-version: "140.0" | |
| - run: firefox --version | |
| # Web extension tests | |
| - run: npm ci | |
| working-directory: ./webext | |
| - name: Web extension tests | |
| run: ./ctl.sh test_webextension | |
| # Interfacer tests | |
| - name: Interfacer tests setup | |
| run: ./ctl.sh interfacer_test_setup | |
| - name: Unit tests | |
| run: ./ctl.sh test_interfacer_units | |
| - name: E2E tests | |
| run: ./ctl.sh test_tty | |
| - name: TTY debug log | |
| if: ${{ failure() }} | |
| run: cat ./interfacer/test/tty/debug.log || echo "No log file" | |
| - name: HTTP Server tests | |
| uses: nick-fields/retry@v2 | |
| with: | |
| max_attempts: 3 | |
| retry_on: error | |
| timeout_minutes: 15 | |
| command: ./ctl.sh test_http_server | |
| - name: HTTP Server debug log | |
| if: ${{ failure() }} | |
| run: cat ./interfacer/test/http-server/debug.log || echo "No log file" | |
| - name: Check for new version | |
| id: check_versions | |
| run: ./ctl.sh github_actions_output_version_status | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| needs: tests | |
| if: github.ref == 'refs/heads/master' && contains(needs.tests.outputs.is_new_version, 'true') | |
| env: | |
| GOPATH: ${{ github.workspace }} | |
| GOBIN: ${{ github.workspace }}/bin | |
| MDN_KEY: ${{ secrets.MDN_KEY }} | |
| DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Setup Deploy Keys | |
| uses: webfactory/ssh-agent@v0.5.4 | |
| with: | |
| # Note that these private keys depend on having an ssh-keygen'd comment with the | |
| # Git remote URL. This is because Github Actions use the *first* matching private | |
| # key and fails if it doesn't match. webfactory/ssh-agent | |
| ssh-private-key: | | |
| ${{ secrets.HOMEBREW_DEPLOY_KEY }} | |
| ${{ secrets.WWW_DEPLOY_KEY }} | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup node | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: Setup go | |
| uses: actions/setup-go@v3 | |
| with: | |
| go-version-file: 'interfacer/go.mod' | |
| - run: npm ci | |
| working-directory: ./webext | |
| - name: Binary Release | |
| run: ./ctl.sh release | |
| - name: Push new tag | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| tags: true | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: tombh | |
| password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | |
| - name: Docker Release | |
| run: ./ctl.sh docker_release | |
| - name: Update Homebrew Tap | |
| run: ./ctl.sh update_homebrew_tap_with_new_version | |
| - name: Update Browsh Website | |
| run: ./ctl.sh update_browsh_website_with_new_version |