Bump golang.org/x/sync from 0.1.0 to 0.4.0 #1212
Workflow file for this run
This file contains 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
# Copyright 2020 Wayback Archiver. All rights reserved. | |
# Use of this source code is governed by the GNU GPL v3 | |
# license that can be found in the LICENSE file. | |
# | |
name: Testing | |
on: | |
push: | |
branches: | |
- "*" | |
paths: | |
- "**/*.go" | |
- "go.mod" | |
- "go.sum" | |
- ".github/workflows/testing.yml" | |
- "Makefile" | |
pull_request: | |
branches: [ main ] | |
types: [ opened, synchronize, reopened ] | |
paths: | |
- "**/*.go" | |
- "go.mod" | |
- "go.sum" | |
- ".github/workflows/testing.yml" | |
- "Makefile" | |
workflow_dispatch: | |
permissions: | |
contents: read | |
# New runs to only cancel in-progress runs of the same workflow. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
testing: | |
name: Testing | |
permissions: | |
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows | |
contents: read # for actions/checkout to fetch code | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
go: [ "1.18", "1.19", "1.20" ] | |
include: | |
# only update test coverage stats with the most recent go version on linux | |
- go: 1.x | |
os: ubuntu-latest | |
update-coverage: true | |
env: | |
SENDER_UID: ${{ secrets.MATRIX_SENDER_UID }} | |
SENDER_PWD: ${{ secrets.MATRIX_SENDER_PWD }} | |
RECVER_UID: ${{ secrets.MATRIX_RECVER_UID }} | |
RECVER_PWD: ${{ secrets.MATRIX_RECVER_PWD }} | |
WAYBACK_IPFS_MODE: ${{ vars.WAYBACK_IPFS_MODE }} | |
WAYBACK_IPFS_HOST: ${{ vars.WAYBACK_IPFS_HOST }} | |
WAYBACK_IPFS_PORT: ${{ vars.WAYBACK_IPFS_PORT }} | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@2e205a28d0e1da00c5f53b161f4067b052c61f34 # v1.5.0 | |
with: | |
egress-policy: audit | |
disable-telemetry: true | |
- name: Set up Go ${{ matrix.go }}.x | |
uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Set up IPFS | |
uses: ibnesayeed/setup-ipfs@3e5452e358dfa43a0fb92496e96c82cf756be94a | |
with: | |
run_daemon: true | |
ipfs_version: ${{ vars.IPFS_VERSION }} | |
- name: Set up Tor | |
uses: tor-actions/setup-tor@462b4eef22eecc86cc4abdedafc95a38667e2557 | |
with: | |
daemon: true | |
- name: Set up Chrome | |
uses: browser-actions/setup-chrome@37c79b7f0199cec79c8b6a414e806d88c8662bdd | |
with: | |
chrome-version: stable | |
- name: Set up Meilisearch | |
if: matrix.os == 'ubuntu-latest' | |
uses: moy2010/meilisearch-github-action@fcc5ef714af0596633665032d459bfb279d3c730 # 0.1.4 | |
with: | |
meilisearch-version: ${{ vars.MEILISEARCH_VERSION }} | |
meilisearch-port: ${{ vars.MEILISEARCH_PORT }} | |
meilisearch-api-key: ${{ vars.MEILISEARCH_APIKEY }} | |
- name: Set up Chocolatey | |
if: matrix.os == 'windows-latest' | |
uses: crazy-max/ghaction-chocolatey@b59ffdb6594d2e2c36d9e1174e15ac799dd0a8f1 # v2.0.0 | |
with: | |
args: -h | |
- name: Install Packages for Linux | |
if: matrix.os == 'ubuntu-latest' | |
shell: bash | |
run: | | |
# search package https://pkgs.org/ | |
sudo add-apt-repository universe | |
sudo apt-get -y -qq update | |
sudo apt-get -y -qq install ffmpeg webp youtube-dl | |
pip3 install you-get | |
echo "youtube-dl version $(youtube-dl --version)" | |
you-get --version | |
ffmpeg -version | |
- name: Install Packages for MacOS | |
if: matrix.os == 'macos-latest' | |
shell: bash | |
run: | | |
# search package https://brew.sh/ | |
brew install --quiet ffmpeg webp youtube-dl you-get | |
echo "youtube-dl version $(youtube-dl --version)" | |
you-get --version | |
ffmpeg -version | |
- name: Install Packages for Windows | |
if: matrix.os == 'windows-latest' | |
shell: bash | |
run: | | |
# search package https://community.chocolatey.org/packages | |
choco install --no-progress wget ffmpeg webp youtube-dl you-get | |
echo "youtube-dl version $(youtube-dl --version)" | |
you-get --version | |
ffmpeg -version | |
wget --help | |
- name: Set environments | |
shell: bash | |
run: | | |
ipfsMode="${{ vars.WAYBACK_IPFS_MODE }}" | |
echo "WAYBACK_IPFS_MODE=${ipfsMode:-daemon}" >> $GITHUB_ENV | |
# Set env to enable reduxer | |
echo "WAYBACK_STORAGE_DIR=${{ runner.temp }}" >> $GITHUB_ENV | |
# Append paths to environment path | |
# echo "$(which youtube-dl)" >> $GITHUB_PATH | |
# echo "$(which you-get)" >> $GITHUB_PATH | |
# echo "$(which ffmpeg)" >> $GITHUB_PATH | |
# echo "$(which wget)" >> $GITHUB_PATH | |
- name: Set environments for Meilisearch | |
if: matrix.os == 'ubuntu-latest' | |
shell: bash | |
run: | | |
# Set env to enable reduxer | |
echo "WAYBACK_MEILI_ENDPOINT=${{ vars.WAYBACK_MEILI_ENDPOINT }}" >> $GITHUB_ENV | |
echo "PLAYBACK_MEILI_ENDPOINT=${{ vars.WAYBACK_MEILI_ENDPOINT }}" >> $GITHUB_ENV | |
echo "WAYBACK_MEILI_APIKEY=${{ vars.MEILISEARCH_APIKEY }}" >> $GITHUB_ENV | |
echo "PLAYBACK_MEILI_APIKEY=${{ vars.MEILISEARCH_APIKEY }}" >> $GITHUB_ENV | |
- name: Check out code base | |
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 | |
with: | |
fetch-depth: 0 | |
- name: Check out code base | |
if: github.event_name == 'pull_request' | |
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Cache go module | |
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
~/Library/Caches/go-build | |
~\AppData\Local\go-build | |
~\go\pkg\mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Get dependencies | |
run: | | |
go get -v -t -d ./... | |
- name: Run test | |
run: | | |
make test | |
make test-cover | |
shell: bash | |
- name: Upload artifact | |
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1 | |
with: | |
name: coverage-${{ matrix.os }} | |
path: coverage.* | |
- name: Upload coverage to Codecov | |
if: ${{ matrix.update-coverage }} | |
uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 #v3.1.0 | |
- name: Run integration test | |
run: make test-integration |